Package app.babylon.table.io
Class RowCursorCsv.Builder
java.lang.Object
app.babylon.table.io.RowCursorCsv.Builder
- Enclosing class:
RowCursorCsv
-
Method Summary
Modifier and TypeMethodDescriptionbuild(InputStream inputStream) withAutoDetectEncoding(boolean autoDetectEncoding) withCharset(Charset charset) withColumnRename(ColumnName original, ColumnName newName) withColumnRenames(Map<ColumnName, ColumnName> renames) withColumnType(ColumnName columnName, Column.Type columnType) Specifies a source-side column type for this CSV cursor.withColumnTypes(Map<ColumnName, Column.Type> columnTypes) Specifies source-side column types to expose throughRowCursor.columns().withFixedWidths(int[] fixedWidths) withHeaderStrategy(HeaderStrategy headerStrategy) withQuote(char quote) withRowFilter(RowFilter rowFilter) withSelectedColumn(ColumnName columnName) withSelectedColumns(ColumnName... columnNames) withSelectedColumns(Collection<ColumnName> columnNames) withSeparator(char separator) withStripping(boolean stripping)
-
Method Details
-
withHeaderStrategy
-
withSelectedColumn
-
withSelectedColumns
-
withSelectedColumns
-
withColumnRename
-
withColumnRenames
-
withRowFilter
-
withSeparator
-
withStripping
-
withQuote
-
withFixedWidths
-
withCharset
-
withAutoDetectEncoding
-
withColumnType
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 namecolumnType- the source-side column type- Returns:
- this builder
-
withColumnTypes
Specifies source-side column types to expose throughRowCursor.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
STRINGand let the row consumer build the natural string dictionary.- Parameters:
columnTypes- source-side column types keyed by column name- Returns:
- this builder
-
build
-