@Internal public class TextTable extends BaseBeamTable
TextTable
is a BeamSqlTable
that reads text
files and converts them according to the specified format.
Support formats are "csv"
and "lines"
.
CSVFormat
itself has many dialects, check its javadoc for more info.
schema
Constructor and Description |
---|
TextTable(Schema schema,
java.lang.String filePattern,
PTransform<PCollection<java.lang.String>,PCollection<Row>> readConverter,
PTransform<PCollection<Row>,PCollection<java.lang.String>> writeConverter)
Text table with the specified read and write transforms.
|
Modifier and Type | Method and Description |
---|---|
PCollection<Row> |
buildIOReader(PBegin begin)
create a
PCollection<Row> from source. |
PDone |
buildIOWriter(PCollection<Row> input)
create a
IO.write() instance to write to target. |
java.lang.String |
getFilePattern() |
BeamTableStatistics |
getRowCount(PipelineOptions options)
Estimates the number of rows or the rate for unbounded Tables.
|
PCollection.IsBounded |
isBounded()
Whether this table is bounded (known to be finite) or unbounded (may or may not be finite).
|
getSchema
public TextTable(Schema schema, java.lang.String filePattern, PTransform<PCollection<java.lang.String>,PCollection<Row>> readConverter, PTransform<PCollection<Row>,PCollection<java.lang.String>> writeConverter)
public java.lang.String getFilePattern()
public BeamTableStatistics getRowCount(PipelineOptions options)
BeamSqlTable
public PCollection.IsBounded isBounded()
BeamSqlTable
public PCollection<Row> buildIOReader(PBegin begin)
BeamSqlTable
PCollection<Row>
from source.public PDone buildIOWriter(PCollection<Row> input)
BeamSqlTable
IO.write()
instance to write to target.