deephaven.ImportTools.CsvImport¶
Tools for programmatically executing CSV batch imports.
-
class
CsvImportBuilder
(*args, **kwargs)¶ -
build
()¶ Creates a CsvImport object using the properties that have been set in the CsvImport.Builder.
- Returns
(com.illumon.iris.importers.util.CsvImport) A CsvImport object.
-
property
builder
¶ The java builder object.
-
setColumnNames
(columnNames)¶ Sets a List of column names to be used when a headerless import is run (CsvImport.Builder.noHeader).
- Parameters
columnNames – java.util.List<java.lang.String>
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setConstantColumnValue
(constantColumnValue)¶ Sets the value to use for source columns with a sourceType of CONSTANT.
- Parameters
constantColumnValue – java.lang.String
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setDelimiter
(delimiter)¶ - Set 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 – char
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setDestinationDirectory
(destinationDirectory)¶ Sets the destination directory.
- Parameters
destinationDirectory – (java.io.File) - destination directory.
- Returns
(ImportBuilder.T) this builder.
-
setDestinationPartitions
(destinationPartitions)¶ Sets the destination partitions
- Overload 1
- param destinationPartitions
(java.lang.String) - destination partitions.
- return
(ImportBuilder.T) this builder.
- Overload 2
- param destinationPartitions
(java.lang.String[]) - destination partitions.
- return
(ImportBuilder.T) this builder.
-
setFileFormat
(fileFormat)¶ Set the file format of the CSV to be imported.
- Parameters
fileFormat – java.lang.String
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setNoHeader
(noHeader)¶ - Sets an indicator that the file does not include a list of columns in it header. When set
a list of column names must also be provided with CsvImport.Builder.columnNames. Default behavior is to expect a column name list in the header.
- Parameters
noHeader – boolean
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setOutputMode
(outputMode)¶ Sets the output mode.
- Overload 1
- param outputMode
(com.illumon.iris.importers.ImportOutputMode) - output mode.
- return
(ImportBuilder.T) this builder.
- Overload 2
- param outputMode
(java.lang.String) - output mode.
- return
(ImportBuilder.T) this builder.
-
setPartitionColumn
(partitionColumn)¶ Sets the partition column.
- Parameters
partitionColumn – (java.lang.String) - partition column.
- Returns
(ImportBuilder.T) this builder.
-
setSchemaService
(schemaService)¶ Sets the schema service.
- Parameters
schemaService – (com.illumon.iris.db.schema.SchemaService) - schema service.
- Returns
(ImportBuilder.T) this builder.
Sets the number of lines to be skipped at the end of files being read.
- Parameters
skipFooterLines – (int) - An int of the number of lines to skip. Default is 0.
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setSkipLines
(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.
- Parameters
skipLines – int
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
setSourceDirectory
(sourceDirectory)¶ Sets the source directory.
- Overload 1
- param sourceDirectory
(java.io.File) - source directory
- return
(FileImportBuilder.T) this builder
- Overload 2
- param sourceDirectory
(java.lang.String) - source directory
- return
(FileImportBuilder.T) this builder
-
setSourceFile
(sourceFile)¶ Sets the source file.
- Parameters
sourceFile – (java.lang.String) - source file
- Returns
(FileImportBuilder.T) this builder
-
setSourceGlob
(sourceGlob)¶ Sets the source glob.
- Parameters
sourceGlob – (java.lang.String) - source glob
- Returns
(FileImportBuilder.T) this builer
-
setSourceName
(sourceName)¶ Sets the source name.
- Parameters
sourceName – (java.lang.String) - source name.
- Returns
(ImportBuilder.T) this builder.
-
setStrict
(strict)¶ Sets strict checking.
- Parameters
strict – (boolean) - strict.
- Returns
(ImportBuilder.T) this builder.
-
setTrim
(trim)¶ Sets whether to trim white space around values within delimited fields.
- Parameters
trim – boolean
- Returns
(com.illumon.iris.importers.util.CsvImport.Builder) this builder.
-
-
builder
(namespace, table)¶ - Creates a new CsvImportBuilder object. Method calls on this object can then be used to configure
the import and run it.
- Parameters
namespace – (java.lang.String) - The String name of the namespace into which data will be imported.
table – (java.lang.String) - The String name of the table into which data will be imported.
- Returns
(com.illumon.iris.importers.util.CsvImportBuilder) A new CsvImportBuilder object.