public final class BeamTableUtils
extends java.lang.Object
BeamTable
.
TODO: Does not yet support nested types.
Constructor and Description |
---|
BeamTableUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
autoCastField(Schema.Field field,
java.lang.Object rawObj)
Attempt to cast an object to a specified Schema.Field.Type.
|
static java.lang.String |
beamRow2CsvLine(Row row,
org.apache.commons.csv.CSVFormat csvFormat) |
static java.lang.Iterable<Row> |
csvLines2BeamRows(org.apache.commons.csv.CSVFormat csvFormat,
java.lang.String line,
Schema schema)
|
public static java.lang.Iterable<Row> csvLines2BeamRows(org.apache.commons.csv.CSVFormat csvFormat, java.lang.String line, Schema schema)
CSVFormat
, and converts them to Rows
with the specified Schema
.
A single "line" read from e.g. TextIO
can have zero or more records, depending on
whether the line was split on the same characters that delimite CSV records, and whether the
CSVFormat
ignores blank lines.
public static java.lang.String beamRow2CsvLine(Row row, org.apache.commons.csv.CSVFormat csvFormat)
public static java.lang.Object autoCastField(Schema.Field field, java.lang.Object rawObj)
java.lang.IllegalArgumentException
- if the value cannot be cast to that type.