Class TestUnboundedTable
- 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.test.TestTable
-
- org.apache.beam.sdk.extensions.sql.meta.provider.test.TestUnboundedTable
-
- All Implemented Interfaces:
java.io.Serializable,BeamSqlTable
public class TestUnboundedTable extends TestTable
A mocked unbounded table.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.extensions.sql.meta.SchemaBaseBeamTable
schema
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TestUnboundedTableaddRows(org.joda.time.Duration duration, java.lang.Object... args)Add rows to the builder.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.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).static TestUnboundedTableof(java.lang.Object... args)Convenient way to build a mocked unbounded table.TestUnboundedTablesetStatistics(BeamTableStatistics statistics)TestUnboundedTabletimestampColumnIndex(int idx)-
Methods inherited from class org.apache.beam.sdk.extensions.sql.meta.provider.test.TestTable
buildIOWriter
-
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
-
-
-
-
Method Detail
-
of
public static TestUnboundedTable of(java.lang.Object... args)
Convenient way to build a mocked unbounded table.e.g.
TestUnboundedTable .of(Types.BIGINT, "order_id", Types.INTEGER, "site_id", Types.DOUBLE, "price", Types.TIMESTAMP, "order_time")
-
setStatistics
public TestUnboundedTable setStatistics(BeamTableStatistics statistics)
-
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
-
timestampColumnIndex
public TestUnboundedTable timestampColumnIndex(int idx)
-
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).
-
addRows
public TestUnboundedTable addRows(org.joda.time.Duration duration, java.lang.Object... args)
Add rows to the builder.Sample usage:
addRows( duration, -- duration which stands for the corresponding watermark instant 1, 3, "james", -- first row 2, 5, "bond" -- second row ... )
-
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.
-
-