metadata.addConnectorMetadata("tpch", "tpch", new TestingMetadata());
metadata.addConnectorMetadata("c2", "c2", new TestingMetadata());
metadata.addConnectorMetadata("c3", "c3", new TestingMetadata());
SchemaTableName table1 = new SchemaTableName("default", "t1");
metadata.createTable(SESSION, "tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table1,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", BIGINT, 0, false),
new ColumnMetadata("b", BIGINT, 1, false),
new ColumnMetadata("c", BIGINT, 2, false),
new ColumnMetadata("d", BIGINT, 3, false)))));
SchemaTableName table2 = new SchemaTableName("default", "t2");
metadata.createTable(SESSION, "tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table2,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", BIGINT, 0, false),
new ColumnMetadata("b", BIGINT, 1, false)))));
SchemaTableName table3 = new SchemaTableName("default", "t3");
metadata.createTable(SESSION, "tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table3,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", BIGINT, 0, false),
new ColumnMetadata("b", BIGINT, 1, false)))));
// table in different catalog
SchemaTableName table4 = new SchemaTableName("s2", "t4");
metadata.createTable(SESSION, "c2", new TableMetadata("tpch", new ConnectorTableMetadata(table4,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", BIGINT, 0, false)))));
// valid view referencing table in same schema
String viewData1 = JsonCodec.jsonCodec(ViewDefinition.class).toJson(