Package com.illumon.iris.importers.util
Interface CsvImportBuilder
public interface CsvImportBuilder
This interface defines the methods necessary for creating a 
CsvImport importer.  Instances may
 be constructed via CsvImport.fromFiles(String, String) or CsvImport.fromStream(String, String, InputStream)- 
Method SummaryModifier and Type Method Description CsvImportbuild()Creates a CsvImport object using the properties that have been set.CsvImportBuildersetColumnNames(List<String> columnNames)Sets a List of column names to be used when a headerless import is run (setNoHeader(boolean)).CsvImportBuildersetConstantColumnValue(String constantColumnValue)Sets the value to use for source columns with a sourceType of CONSTANT.CsvImportBuildersetDelimiter(char delimiter)Set the CSV field delimiter character.CsvImportBuildersetDestinationDirectory(File destinationDirectory)Set the destination directory to import the table to.CsvImportBuildersetDestinationPartitions(String destinationPartitions)Set the partition into which the data will be written.CsvImportBuildersetDestinationPartitions(String[] destinationPartitions)Set the partition into which the data will be written, as a set of path components.CsvImportBuildersetFileFormat(String fileFormat)Set the file format of the CSV to be imported.CsvImportBuildersetNoHeader(boolean noHeader)Indicates that the file or stream does not include a list of columns in the header.CsvImportBuildersetOutputMode(ImportOutputMode outputMode)Set the mode used when writing the output file.CsvImportBuildersetOutputMode(String outputMode)Set the mode used when writing the output file.CsvImportBuildersetPartitionColumn(String partitionColumn)Set the column to use to determine the partition.CsvImportBuildersetSkipLines(int skipLines)Sets the number of lines to be skipped at the beginning of files being read before expecting the first line of column names or data.CsvImportBuildersetSourceDirectory(File sourceDirectory)Set the directory to search for files in.CsvImportBuildersetSourceDirectory(String sourceDirectory)Set the directory to search for files in.CsvImportBuildersetSourceFile(String sourceFile)Set the source file to load.CsvImportBuildersetSourceGlob(String sourceGlob)Set the source glob to locate files in.CsvImportBuildersetSourceName(String sourceName)Set the name of the ImportSource from the schema to be used during the import process.CsvImportBuildersetStrict(boolean strict)CsvImportBuildersetTrim(boolean trim)Sets whether to trim white space around values within delimited fields.
- 
Method Details- 
setDestinationPartitionsSet the partition into which the data will be written.- Parameters:
- destinationPartitions- the destination partition.
- Returns:
- this CsvImportBuilder
 
- 
setDestinationPartitionsSet the partition into which the data will be written, as a set of path components.- Parameters:
- destinationPartitions- the destination partition.
- Returns:
- this CsvImportBuilder
 
- 
setDestinationDirectorySet the destination directory to import the table to.- Parameters:
- destinationDirectory- the destination directory
- Returns:
- this CsvImportBuilder
 
- 
setOutputModeSet the mode used when writing the output file. SeeImportOutputModefor details.- Parameters:
- outputMode- the output mode to use.
- Returns:
- this CsvImportBuilder
 
- 
setOutputModeSet the mode used when writing the output file. SeeImportOutputModefor details.- Parameters:
- outputMode- the output mode to use.
- Returns:
- this CsvImportBuilder
 
- 
setPartitionColumnSet the column to use to determine the partition.- Parameters:
- partitionColumn- the name of the partitioning column
- Returns:
- this CsvImportBuilder
 
- 
setStrict- Parameters:
- strict-
- Returns:
- this CsvImportBuilder
 
- 
setSourceDirectorySet the directory to search for files in. If this is not provided, the default system log path configured by deephaven properties is used.- Parameters:
- sourceDirectory- the source directory
- Returns:
- this CsvImportBuilder
 
- 
setSourceDirectorySet the directory to search for files in. If this is not provided, the default system log path configured by deephaven properties is used.- Parameters:
- sourceDirectory- the source directory
- Returns:
- this CsvImportBuilder
 
- 
setSourceFileSet the source file to load. When this value is specified thesetSourceGlob(String)is ignored.- Parameters:
- sourceFile- the path to the file to import. This should be relative to the path specified by- setSourceDirectory(java.io.File).
- Returns:
- this CsvImportBuilder
 
- 
setSourceGlobSet the source glob to locate files in. This value ignored whensetSourceFile(String)is specified.- Parameters:
- sourceGlob- The source file glob. This should be relative to the path specified by- setSourceDirectory(java.io.File).
- Returns:
- this CsvImportBuilder
 
- 
setSourceNameSet the name of the ImportSource from the schema to be used during the import process.- Parameters:
- sourceName- the name of the ImportSource
- Returns:
- this CsvImportBuilder
 
- 
setFileFormatSet the file format of the CSV to be imported.- Parameters:
- fileFormat- A String of:- DEFAULT – default format if none is specified; comma-separated field values, newline row terminators, double-quotes around field values that contain embedded commas, newline characters, or double-quotes.
- TRIM - Similar to DEFAULT, but will trim all white space around values.
- EXCEL – The Microsoft Excel CSV format
- MYSQL – The MySQL CSV format
- RFC4180 – IETF RFC 4180 MIME text/csv format
- TDF – Tab-delimited format
 
- Returns:
- this builder.
 
- 
setDelimiterSet the CSV field delimiter character. Default is comma. This can be used to set a different character such as pipe (|), semi-colon (;), or any other single character.- Parameters:
- delimiter- The char to use as a field delimiter.
- Returns:
- this builder.
 
- 
setSkipLinesSets the number of lines to be skipped at the beginning of files being read before expecting the first line of column names or data.- Parameters:
- skipLines- An int of the number of lines to skip. Default is 0.
- Returns:
- this builder.
 
- 
setTrimSets whether to trim white space around values within delimited fields.- Parameters:
- trim- boolean true or false. Default is false.
- Returns:
- this builder.
 
- 
setNoHeaderIndicates that the file or stream does not include a list of columns in the header. When set, a list of column names must also be provided withsetColumnNames(List). Default behavior is to expect a column name list in the header.- Parameters:
- noHeader- boolean true or false. Default is false.
- Returns:
- this builder.
 
- 
setColumnNamesSets a List of column names to be used when a headerless import is run (setNoHeader(boolean)).- Parameters:
- columnNames- A List of Strings of column names in order left to right.
- Returns:
- this builder.
 
- 
setConstantColumnValueSets the value to use for source columns with a sourceType of CONSTANT.- Parameters:
- constantColumnValue- String value for the constant column.
- Returns:
- this builder.
 
- 
buildCsvImport build()Creates a CsvImport object using the properties that have been set.- Returns:
- A CsvImportobject.
 
 
-