@AutoService(value=TableProvider.class) public class TestTableProvider extends InMemoryMetaTableProvider
Keeps global state and tracks class instances. Works only in DirectRunner.
Constructor and Description |
---|
TestTableProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addRows(java.lang.String tableName,
Row... rows) |
BeamSqlTable |
buildBeamSqlTable(Table table)
Build a
BeamSqlTable using the given table meta info. |
void |
createTable(Table table)
Creates a table.
|
void |
dropTable(java.lang.String tableName)
Drops a table.
|
java.util.Map<java.lang.String,Table> |
getTables()
Get all tables from this provider.
|
java.lang.String |
getTableType()
Gets the table type this provider handles.
|
java.util.List<Row> |
tableRows(java.lang.String tableName) |
java.util.Map<java.lang.String,org.apache.beam.sdk.extensions.sql.meta.provider.test.TestTableProvider.TableWithRows> |
tables() |
public java.lang.String getTableType()
TableProvider
public java.util.Map<java.lang.String,org.apache.beam.sdk.extensions.sql.meta.provider.test.TestTableProvider.TableWithRows> tables()
public void createTable(Table table)
TableProvider
createTable
in interface TableProvider
createTable
in class InMemoryMetaTableProvider
public void dropTable(java.lang.String tableName)
TableProvider
dropTable
in interface TableProvider
dropTable
in class InMemoryMetaTableProvider
public java.util.Map<java.lang.String,Table> getTables()
TableProvider
getTables
in interface TableProvider
getTables
in class InMemoryMetaTableProvider
public BeamSqlTable buildBeamSqlTable(Table table)
TableProvider
BeamSqlTable
using the given table meta info.public void addRows(java.lang.String tableName, Row... rows)
public java.util.List<Row> tableRows(java.lang.String tableName)