Class BeamTableUtils
java.lang.Object
org.apache.beam.sdk.extensions.sql.impl.schema.BeamTableUtils
Utility methods for working with
BeamTable.
TODO: Does not yet support nested types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectautoCastField(Schema.Field field, @Nullable Object rawObj) Attempt to cast an object to a specified Schema.Field.Type.static StringbeamRow2CsvLine(Row row, CSVFormat csvFormat) csvLines2BeamRows(CSVFormat csvFormat, String line, Schema schema)
-
Constructor Details
-
BeamTableUtils
public BeamTableUtils()
-
-
Method Details
-
csvLines2BeamRows
Decode zero or more CSV records from the given string, according to the specifiedCSVFormat, and converts them toRowswith the specifiedSchema.A single "line" read from e.g.
TextIOcan have zero or more records, depending on whether the line was split on the same characters that delimite CSV records, and whether theCSVFormatignores blank lines. -
beamRow2CsvLine
-
autoCastField
Attempt to cast an object to a specified Schema.Field.Type.- Returns:
- The casted object in Schema.Field.Type.
- Throws:
IllegalArgumentException- if the value cannot be cast to that type.
-