use of org.apache.beam.sdk.extensions.sql.BeamSqlCli in project beam by apache.
the class BigtableTableFlatTest method testCreatesFlatSchemaCorrectly.
@Test
public void testCreatesFlatSchemaCorrectly() {
final String tableId = "flatTableSchema";
InMemoryMetaStore metaStore = new InMemoryMetaStore();
metaStore.registerProvider(new BigtableTableProvider());
BeamSqlCli cli = new BeamSqlCli().metaStore(metaStore);
cli.execute(createFlatTableString(tableId, location(tableId)));
Table table = metaStore.getTables().get(tableId);
assertNotNull(table);
assertEquals(TEST_FLAT_SCHEMA, table.getSchema());
JSONObject properties = table.getProperties();
assertTrue(properties.containsKey(COLUMNS_MAPPING));
assertEquals(columnsMappingString(), properties.getString(COLUMNS_MAPPING));
}
use of org.apache.beam.sdk.extensions.sql.BeamSqlCli in project beam by apache.
the class BigtableTableWithRowsTest method testCreatesSchemaCorrectly.
@Test
public void testCreatesSchemaCorrectly() {
InMemoryMetaStore metaStore = new InMemoryMetaStore();
metaStore.registerProvider(new BigtableTableProvider());
BeamSqlCli cli = new BeamSqlCli().metaStore(metaStore);
cli.execute(createFullTableString(TABLE, location()));
Table table = metaStore.getTables().get("beamTable");
assertNotNull(table);
assertEquals(TEST_SCHEMA, table.getSchema());
}
Aggregations