Class TextTable
- java.lang.Object
-
- org.apache.beam.sdk.extensions.sql.meta.BaseBeamTable
-
- org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable
-
- org.apache.beam.sdk.extensions.sql.meta.provider.text.TextTable
-
- All Implemented Interfaces:
java.io.Serializable,BeamSqlTable
- Direct Known Subclasses:
TextJsonTable
@Internal public class TextTable extends SchemaBaseBeamTable
TextTableis aBeamSqlTablethat reads text files and converts them according to the specified format.Support formats are
"csv"and"lines".CSVFormatitself has many dialects, check its javadoc for more info.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable
schema
-
-
Constructor Summary
Constructors Constructor Description TextTable(org.apache.beam.sdk.schemas.Schema schema, java.lang.String filePattern, org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<java.lang.String>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row>> readConverter, org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row>,org.apache.beam.sdk.values.PCollection<java.lang.String>> writeConverter)Text table with the specified read and write transforms.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row>buildIOReader(org.apache.beam.sdk.values.PBegin begin)create aPCollection<Row>from source.org.apache.beam.sdk.values.PDonebuildIOWriter(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row> input)create aIO.write()instance to write to target.java.lang.StringgetFilePattern()BeamTableStatisticsgetTableStatistics(org.apache.beam.sdk.options.PipelineOptions options)Estimates the number of rows or the rate for unbounded Tables.org.apache.beam.sdk.values.PCollection.IsBoundedisBounded()Whether this table is bounded (known to be finite) or unbounded (may or may not be finite).-
Methods inherited from class org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable
getSchema
-
Methods inherited from class org.apache.beam.sdk.extensions.sql.meta.BaseBeamTable
buildIOReader, constructFilter, supportsProjects
-
-
-
-
Constructor Detail
-
TextTable
public TextTable(org.apache.beam.sdk.schemas.Schema schema, java.lang.String filePattern, org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<java.lang.String>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row>> readConverter, org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row>,org.apache.beam.sdk.values.PCollection<java.lang.String>> writeConverter)Text table with the specified read and write transforms.
-
-
Method Detail
-
getFilePattern
public java.lang.String getFilePattern()
-
getTableStatistics
public BeamTableStatistics getTableStatistics(org.apache.beam.sdk.options.PipelineOptions options)
Description copied from interface:BeamSqlTableEstimates the number of rows or the rate for unbounded Tables. If it is not possible to estimate the row count or rate it will return BeamTableStatistics.BOUNDED_UNKNOWN.- Specified by:
getTableStatisticsin interfaceBeamSqlTable- Overrides:
getTableStatisticsin classBaseBeamTable
-
isBounded
public org.apache.beam.sdk.values.PCollection.IsBounded isBounded()
Description copied from interface:BeamSqlTableWhether this table is bounded (known to be finite) or unbounded (may or may not be finite).
-
buildIOReader
public org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row> buildIOReader(org.apache.beam.sdk.values.PBegin begin)
Description copied from interface:BeamSqlTablecreate aPCollection<Row>from source.
-
buildIOWriter
public org.apache.beam.sdk.values.PDone buildIOWriter(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.Row> input)
Description copied from interface:BeamSqlTablecreate aIO.write()instance to write to target.
-
-