Class RowCursorCsv.Builder

java.lang.Object
app.babylon.table.io.RowCursorCsv.Builder
Enclosing class:
RowCursorCsv

public static final class RowCursorCsv.Builder extends Object
  • Method Details

    • withHeaderStrategy

      public RowCursorCsv.Builder withHeaderStrategy(HeaderStrategy headerStrategy)
    • withSeparator

      public RowCursorCsv.Builder withSeparator(char separator)
    • withStripping

      public RowCursorCsv.Builder withStripping(boolean stripping)
    • withQuote

      public RowCursorCsv.Builder withQuote(char quote)
    • withFixedWidths

      public RowCursorCsv.Builder withFixedWidths(int[] fixedWidths)
    • withCharset

      public RowCursorCsv.Builder withCharset(Charset charset)
    • withAutoDetectEncoding

      public RowCursorCsv.Builder withAutoDetectEncoding(boolean autoDetectEncoding)
    • withColumnType

      public RowCursorCsv.Builder withColumnType(ColumnName columnName, Column.Type columnType)
      Specifies a source-side column type for this CSV cursor.

      This type becomes part of the cursor schema returned by RowCursor.columns() and can therefore influence which builder the row consumer chooses before any rows are read.

      For categorical text columns, this is typically only worth doing when the direct parser is materially better than first building the string dictionary.

      Parameters:
      columnName - the source column name
      columnType - the source-side column type
      Returns:
      this builder
    • withColumnTypes

      public RowCursorCsv.Builder withColumnTypes(Map<ColumnName,Column.Type> columnTypes)
      Specifies source-side column types to expose through RowCursor.columns().

      These types are consumed before rows are read, so they can select a more direct builder and bypass intermediate string materialization when the type has an efficient slice-based parser.

      In normal categorical-text cases, it is often still preferable to leave the source as STRING and let the row consumer build the natural string dictionary.

      Parameters:
      columnTypes - source-side column types keyed by column name
      Returns:
      this builder
    • build

      public RowCursorCsv build(InputStream inputStream)