CsvReadOptions.Builder
, FixedWidthReadOptions.Builder
protected static class ReadOptions.Builder extends Object
Modifier and Type | Field | Description |
---|---|---|
protected Function<String,Optional<ColumnType>> |
columnTypeFunction |
|
protected Map<String,ColumnType> |
columnTypeMap |
|
protected ColumnType[] |
columnTypes |
|
protected List<ColumnType> |
columnTypesToDetect |
|
protected Function<String,ColumnType> |
completeColumnTypeFunction |
|
protected String |
dateFormat |
|
protected DateTimeFormatter |
dateFormatter |
|
protected String |
dateTimeFormat |
|
protected DateTimeFormatter |
dateTimeFormatter |
|
protected boolean |
header |
|
protected boolean |
ignoreZeroDecimal |
|
protected Locale |
locale |
|
protected int |
maxCharsPerColumn |
|
protected boolean |
minimizeColumnSizes |
|
protected String[] |
missingValueIndicators |
|
protected boolean |
sample |
|
protected boolean |
skipRowsWithInvalidColumnCount |
|
protected Source |
source |
|
protected String |
tableName |
|
protected String |
timeFormat |
|
protected DateTimeFormatter |
timeFormatter |
Modifier | Constructor | Description |
---|---|---|
protected |
Builder() |
|
protected |
Builder(File file) |
|
protected |
Builder(InputStream stream) |
|
protected |
Builder(InputStreamReader reader) |
|
protected |
Builder(Reader reader) |
|
protected |
Builder(URL url) |
|
protected |
Builder(Source source) |
Modifier and Type | Method | Description |
---|---|---|
ReadOptions.Builder |
allowDuplicateColumnNames(Boolean allow) |
|
ReadOptions |
build() |
|
ReadOptions.Builder |
columnTypes(Function<String,ColumnType> columnTypeFunction) |
Provide a function that determines ColumnType for all column names.
|
ReadOptions.Builder |
columnTypes(ColumnType[] columnTypes) |
Provide column types for all columns skipping autodetect column type logic.
|
ReadOptions.Builder |
columnTypesPartial(Function<String,Optional<ColumnType>> columnTypeFunction) |
Provide a function that determines ColumnType for some column names.
|
ReadOptions.Builder |
columnTypesPartial(Map<String,ColumnType> columnTypeByName) |
Provide a map that determines ColumnType for given column names.
|
ReadOptions.Builder |
columnTypesToDetect(List<ColumnType> columnTypesToDetect) |
|
ReadOptions.Builder |
dateFormat(String dateFormat) |
Deprecated.
|
ReadOptions.Builder |
dateFormat(DateTimeFormatter dateFormat) |
|
ReadOptions.Builder |
dateTimeFormat(String dateTimeFormat) |
Deprecated.
|
ReadOptions.Builder |
dateTimeFormat(DateTimeFormatter dateFormat) |
|
ReadOptions.Builder |
header(boolean hasHeader) |
|
ReadOptions.Builder |
ignoreZeroDecimal(boolean ignoreZeroDecimal) |
Ignore zero value decimals in data values.
|
ReadOptions.Builder |
locale(Locale locale) |
|
ReadOptions.Builder |
maxCharsPerColumn(int maxCharsPerColumn) |
|
ReadOptions.Builder |
minimizeColumnSizes() |
Allow the
ColumnTypeDetector to choose shorter column types such as float instead of
double when the data will fit in a smaller type |
ReadOptions.Builder |
missingValueIndicator(String... missingValueIndicators) |
|
ReadOptions.Builder |
sample(boolean sample) |
|
ReadOptions.Builder |
skipRowsWithInvalidColumnCount(boolean skipRowsWithInvalidColumnCount) |
Skip the rows with invalid column count in data values.
|
ReadOptions.Builder |
tableName(String tableName) |
|
ReadOptions.Builder |
timeFormat(String timeFormat) |
Deprecated.
|
ReadOptions.Builder |
timeFormat(DateTimeFormatter dateFormat) |
protected final Source source
protected String tableName
protected List<ColumnType> columnTypesToDetect
protected boolean sample
protected String dateFormat
protected DateTimeFormatter dateFormatter
protected String timeFormat
protected DateTimeFormatter timeFormatter
protected String dateTimeFormat
protected DateTimeFormatter dateTimeFormatter
protected Locale locale
protected String[] missingValueIndicators
protected boolean minimizeColumnSizes
protected boolean header
protected int maxCharsPerColumn
protected boolean ignoreZeroDecimal
protected boolean skipRowsWithInvalidColumnCount
protected ColumnType[] columnTypes
protected Map<String,ColumnType> columnTypeMap
protected Function<String,Optional<ColumnType>> columnTypeFunction
protected Function<String,ColumnType> completeColumnTypeFunction
protected Builder()
protected Builder(Source source)
protected Builder(File file)
protected Builder(URL url) throws IOException
IOException
protected Builder(InputStream stream)
protected Builder(InputStreamReader reader)
protected Builder(Reader reader)
public ReadOptions.Builder tableName(String tableName)
public ReadOptions.Builder header(boolean hasHeader)
@Deprecated public ReadOptions.Builder dateFormat(String dateFormat)
public ReadOptions.Builder dateFormat(DateTimeFormatter dateFormat)
public ReadOptions.Builder allowDuplicateColumnNames(Boolean allow)
@Deprecated public ReadOptions.Builder timeFormat(String timeFormat)
public ReadOptions.Builder timeFormat(DateTimeFormatter dateFormat)
@Deprecated public ReadOptions.Builder dateTimeFormat(String dateTimeFormat)
public ReadOptions.Builder dateTimeFormat(DateTimeFormatter dateFormat)
public ReadOptions.Builder missingValueIndicator(String... missingValueIndicators)
public ReadOptions.Builder maxCharsPerColumn(int maxCharsPerColumn)
public ReadOptions.Builder ignoreZeroDecimal(boolean ignoreZeroDecimal)
true
.public ReadOptions.Builder skipRowsWithInvalidColumnCount(boolean skipRowsWithInvalidColumnCount)
false
.public ReadOptions.Builder sample(boolean sample)
public ReadOptions.Builder locale(Locale locale)
public ReadOptions.Builder columnTypesToDetect(List<ColumnType> columnTypesToDetect)
ColumnTypeDetector
public ReadOptions.Builder minimizeColumnSizes()
ColumnTypeDetector
to choose shorter column types such as float instead of
double when the data will fit in a smaller typepublic ReadOptions.Builder columnTypes(ColumnType[] columnTypes)
public ReadOptions.Builder columnTypes(Function<String,ColumnType> columnTypeFunction)
columnTypesPartial(Function)
This method is generally more efficient because it skips column type detection
public ReadOptions.Builder columnTypesPartial(Function<String,Optional<ColumnType>> columnTypeFunction)
columnTypes(Function)
that generally is more efficient because it
skips column type detectionpublic ReadOptions.Builder columnTypesPartial(Map<String,ColumnType> columnTypeByName)
columnTypes(Function)
that generally is more efficient because it skips column type
detectionpublic ReadOptions build()
Copyright © 2022. All rights reserved.