Package com.illumon.iris.importers.csv
Class CsvImportTools
java.lang.Object
com.illumon.iris.importers.csv.CsvImportTools
Util class that provides ability to import csv using dhc-fast-csv parser.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
importCsv
(InputStream stream, io.deephaven.csv.CsvSpecs.Builder specBuilder, ImportTableWriterFactory tableWriterFactory, com.fishlib.io.logger.Logger log, List<String> columnNamesInFile, Map<String, ImporterColumnDefinition> icdMap, Map<String, String> importProperties, AtomicInteger errorCount, String arrayDelimiter, String constantColumnValue, String currentPartition, int maxError, boolean strict, boolean fromSplitFile) Imports and writes the csv data to disk.
-
Constructor Details
-
CsvImportTools
public CsvImportTools()
-
-
Method Details
-
importCsv
public static long importCsv(@NotNull InputStream stream, @NotNull io.deephaven.csv.CsvSpecs.Builder specBuilder, @NotNull ImportTableWriterFactory tableWriterFactory, @NotNull com.fishlib.io.logger.Logger log, @NotNull List<String> columnNamesInFile, @NotNull Map<String, ImporterColumnDefinition> icdMap, @NotNull Map<String, throws IOExceptionString> importProperties, @NotNull AtomicInteger errorCount, @NotNull String arrayDelimiter, @Nullable String constantColumnValue, @Nullable String currentPartition, int maxError, boolean strict, boolean fromSplitFile) Imports and writes the csv data to disk.- Parameters:
stream
- InputStream from which to read CSV dataspecBuilder
- The CsvSpecs.BuildertableWriterFactory
- The passed down ImportTableWriterFactorylog
- The passed-down loggercolumnNamesInFile
- The column headers in sourceicdMap
- The column name to ImporterColumnDefinition mapimportProperties
- Provides basic import attributeserrorCount
- Holds the current error count across all parsers being used to import csvarrayDelimiter
- Delimiter used to parse array data typesconstantColumnValue
- A String to materialize as the source column when an ImportColumn is defined with a sourceType of CONSTANT (aka ImporterColumnDefinition$IrisImportConstant). Can be null.currentPartition
- The partition value if coming from split FilemaxError
- Maximum number of field conversion failures allowedstrict
- Whether to fail if a field fails conversionfromSplitFile
- Indicates if invoked from splitFile (the significance there will be only one partition)- Returns:
- Returns the number of rows processed
- Throws:
IOException
- thrown when encountering an error in the import call
-