@BeforeMethod(alwaysRun = true)
public void setup()
throws Exception
{
MetadataManager metadata = new MetadataManager();
metadata.addConnectorMetadata("tpch", "tpch", new InMemoryMetadata());
SchemaTableName table1 = new SchemaTableName("default", "t1");
metadata.createTable("tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table1,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", ColumnType.LONG, 0, false),
new ColumnMetadata("b", ColumnType.LONG, 1, false),
new ColumnMetadata("c", ColumnType.LONG, 2, false),
new ColumnMetadata("d", ColumnType.LONG, 3, false)))));
SchemaTableName table2 = new SchemaTableName("default", "t2");
metadata.createTable("tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table2,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", ColumnType.LONG, 0, false),
new ColumnMetadata("b", ColumnType.LONG, 1, false)))));
SchemaTableName table3 = new SchemaTableName("default", "t3");
metadata.createTable("tpch", new TableMetadata("tpch", new ConnectorTableMetadata(table3,
ImmutableList.<ColumnMetadata>of(
new ColumnMetadata("a", ColumnType.LONG, 0, false),
new ColumnMetadata("b", ColumnType.LONG, 1, false)))));
analyzer = new Analyzer(new Session("user", "test", "tpch", "default", null, null), metadata, Optional.<QueryExplainer>absent(), true);