Class CsvSchemaCreator

java.lang.Object
io.deephaven.importers.CsvSchemaCreator

@Immutable public abstract class CsvSchemaCreator extends Object
Reads a CSV file and attempts to infer column data types and create appropriate schema and importer instructions. Also legalizes column names and adds corresponding ImportColumn entries for translation of column names.
  • Constructor Details

    • CsvSchemaCreator

      public CsvSchemaCreator()
  • Method Details

    • builder

      public static CsvSchemaCreator.Builder builder()
      Creates a builder for CsvSchemaCreator.
      Returns:
      the new builder
    • logger

      @Default protected Logger logger()
    • progress

      @Default protected io.deephaven.shadow.enterprise.com.illumon.util.progress.StatusCallback progress()
    • namespace

      protected abstract String namespace()
    • tableName

      protected abstract String tableName()
    • groupingColumn

      protected abstract Optional<String> groupingColumn()
    • partitionColumn

      protected abstract Optional<String> partitionColumn()
    • sourceName

      protected abstract String sourceName()
    • sourcePartitionColumn

      protected abstract Optional<String> sourcePartitionColumn()
    • fileFormat

      @Default protected CsvFormats fileFormat()
    • delimiter

      @Default protected char delimiter()
    • skipHeaderLines

      @Default protected int skipHeaderLines()
    • skipFooterLines

      @Default protected int skipFooterLines()
    • sourceFile

      @Nullable protected abstract @Nullable File sourceFile()
    • csvString

      @Nullable protected abstract @Nullable String csvString()
    • bestFit

      @Default protected boolean bestFit()
    • trim

      @Default protected boolean trim()
    • noHeader

      @Default protected boolean noHeader()
    • columnNames

      protected abstract List<String> columnNames()
    • logProgress

      @Default protected boolean logProgress()
    • maxRows

      @Default protected long maxRows()
    • casingStyle

      @Default protected CasingStyle casingStyle()
    • replacement

      @Default protected String replacement()
    • checkPartitionColumn

      @Check protected void checkPartitionColumn()
    • checkColumns

      @Check protected void checkColumns()
    • checkInputValues

      @Check protected void checkInputValues()
    • inferSchemaFromCsv

      public String inferSchemaFromCsv() throws IOException, CsvFormatException, io.deephaven.csv.util.CsvReaderException
      Reads the specified CSV file and attempts to infer column data types and create appropriate schema and importer.
      Returns:
      the created schema as a String
      Throws:
      io.deephaven.csv.util.CsvReaderException - from the CSV reader
      CsvFormatException - from the CSV reader
      IOException - from the CSV reader