Package io.deephaven.importers
Interface CsvSchemaCreator.Builder
- Enclosing class:
- CsvSchemaCreator
public static interface CsvSchemaCreator.Builder
A Builder object for
CsvSchemaCreator.-
Method Summary
Modifier and TypeMethodDescriptionaddAllColumnNames(Iterable<String> elements) An optional list of column names to use whennoHeader(boolean)is true.addColumnNames(String... elements) An optional list of column names to use whennoHeader(boolean)is true.bestFit(boolean bestFit) Whether to try to use smaller types like int and float, or to use bigger types, like long and double.build()Build theCsvSchemaCreatorcasingStyle(CasingStyle casingStyle) TheCasingStyleto use when generating column names.An optional CSV string to be used for schema creation.delimiter(char delimiter) The CSV field delimiter.fileFormat(CsvFormats fileFormat) The file format to use when reading the CSV fromCsvFormats.groupingColumn(String groupingColumn) The grouping column for the table.The Logger to use.logProgress(boolean logProgress) Whether to update the log with progress percentages.maxRows(long maxRows) The maximum number of rows to read from the CSV file.The namespace for the table.noHeader(boolean noHeader) Iftruethe CSV does not contain a header row.partitionColumn(String partitionColumn) The partition column for the table.replacement(String replacement) String to use for replacements of space or hyphen in source column names.skipFooterLines(int skipFooterLines) The number of lines to skip from the end of the CSV file.skipHeaderLines(int skipHeaderLines) The number of lines to skip at the top of the CSV file before trying to read the header row.sourceFile(@NotNull File sourceFile) The source CSVFileto be used for schema creation.sourceName(String sourceName) The import source name.sourcePartitionColumn(String sourcePartitionColumn) The column name in the source data to use for multi-partition imports, added in the schema'sImportSourceelement.The table name for the table.trim(boolean trim) Whether to trim data around values between delimiters.
-
Method Details
-
namespace
The namespace for the table. This is added to the schema in thenamespaceattribute of theTableelement.- Parameters:
namespace- the namespace- Returns:
- this
CsvSchemaCreator.Builder
-
tableName
The table name for the table. This is added to the schema in thenameattribute of theTableelement.- Parameters:
tableName- the table name- Returns:
- this
CsvSchemaCreator.Builder
-
groupingColumn
The grouping column for the table. This is added to the schema by addingcolumnType="Grouping"to the specified column's definition.- Parameters:
groupingColumn- the grouping column- Returns:
- this
CsvSchemaCreator.Builder
-
partitionColumn
The partition column for the table. This is added to the schema by addingcolumnType="Partitioning"to the specified column's definition.- Parameters:
partitionColumn- the partitioning column- Returns:
- this
CsvSchemaCreator.Builder
-
sourceName
The import source name. This defines the schema'sImportSourcename attribute.- Parameters:
sourceName- the import source name- Returns:
- this
CsvSchemaCreator.Builder
-
sourcePartitionColumn
The column name in the source data to use for multi-partition imports, added in the schema'sImportSourceelement.- Parameters:
sourcePartitionColumn- the column name- Returns:
- this
CsvSchemaCreator.Builder
-
fileFormat
The file format to use when reading the CSV fromCsvFormats. Default isCsvFormats.DEFAULT.- Parameters:
fileFormat- the file format- Returns:
- this
CsvSchemaCreator.Builder
-
delimiter
The CSV field delimiter. Default is ','.- Parameters:
delimiter- the delimiter- Returns:
- this
CsvSchemaCreator.Builder
-
skipHeaderLines
The number of lines to skip at the top of the CSV file before trying to read the header row. Default is 0.- Parameters:
skipHeaderLines- the number of lines to skip- Returns:
- this
CsvSchemaCreator.Builder
-
sourceFile
The source CSVFileto be used for schema creation. Either this orcsvString(String)must be set, but not both.- Parameters:
sourceFile- the source file- Returns:
- this
CsvSchemaCreator.Builder
-
csvString
An optional CSV string to be used for schema creation. Either this orsourceFile(File)must be set, but not both.- Parameters:
csvString- the CSV string- Returns:
- this
CsvSchemaCreator.Builder
-
bestFit
Whether to try to use smaller types like int and float, or to use bigger types, like long and double. Iftruethen try to use smaller types. Default is false.- Parameters:
bestFit- if true, use best-fit parsing to determine column types- Returns:
- this
CsvSchemaCreator.Builder
-
trim
Whether to trim data around values between delimiters. Default is false.- Parameters:
trim- whether to trim- Returns:
- this
CsvSchemaCreator.Builder
-
noHeader
Iftruethe CSV does not contain a header row. Default is false.- Parameters:
noHeader- whether there is no header- Returns:
- this
CsvSchemaCreator.Builder
-
addColumnNames
An optional list of column names to use whennoHeader(boolean)is true. May be null or empty ifnoHeader(boolean)is false. Empty or null lists are treated the same (as if no column names were passed).- Parameters:
elements- column names to use if the CSV has no header- Returns:
- this
CsvSchemaCreator.Builder
-
addAllColumnNames
An optional list of column names to use whennoHeader(boolean)is true. May be null or empty ifnoHeader(boolean)is false. Empty or null lists are treated the same (as if no column names were passed).- Parameters:
elements- column names to use if the CSV has no header- Returns:
- this
CsvSchemaCreator.Builder
-
logProgress
Whether to update the log with progress percentages. Default is false.- Parameters:
logProgress- whether to log progress- Returns:
- this
CsvSchemaCreator.Builder
-
maxRows
The maximum number of rows to read from the CSV file. 0 or lower means read all rows. Default is -1 (read all rows).- Parameters:
maxRows- the maximum number of rows to read- Returns:
- this
CsvSchemaCreator.Builder
-
casingStyle
TheCasingStyleto use when generating column names. Default isCasingStyle.None.- Parameters:
casingStyle- the casing style- Returns:
- this
CsvSchemaCreator.Builder
-
replacement
String to use for replacements of space or hyphen in source column names. Default is_.- Parameters:
replacement- the replacement String- Returns:
- this
CsvSchemaCreator.Builder
-
logger
- Parameters:
logger- the logger- Returns:
- this
CsvSchemaCreator.Builder
-
build
CsvSchemaCreator build()Build theCsvSchemaCreator- Returns:
- the built
CsvSchemaCreator
-