use of org.apache.drill.exec.proto.UserProtos.TableMetadata in project drill by apache.
the class TestMetadataProvider method tables.
@Test
public void tables() throws Exception {
// test("SELECT * FROM INFORMATION_SCHEMA.`TABLES`"); // SQL equivalent
GetTablesResp resp = client.getTables(null, null, null, null).get();
assertEquals(RequestStatus.OK, resp.getStatus());
List<TableMetadata> tables = resp.getTablesList();
assertEquals(22, tables.size());
verifyTable("information_schema", "CATALOGS", tables);
verifyTable("information_schema", "COLUMNS", tables);
verifyTable("information_schema", "SCHEMATA", tables);
verifyTable("information_schema", "TABLES", tables);
verifyTable("information_schema", "VIEWS", tables);
verifyTable("information_schema", "PARTITIONS", tables);
verifyTable("information_schema", "FILES", tables);
// Verify System Tables
for (SystemTable sysTbl : SystemTable.values()) {
verifyTable("sys", sysTbl.getTableName(), tables);
}
}
use of org.apache.drill.exec.proto.UserProtos.TableMetadata in project drill by apache.
the class TestMetadataProvider method tablesWithSystemTableFilter.
@Test
public void tablesWithSystemTableFilter() throws Exception {
// test("SELECT * FROM INFORMATION_SCHEMA.`TABLES` WHERE TABLE_TYPE IN ('SYSTEM_TABLE')"); // SQL equivalent
GetTablesResp resp = client.getTables(null, null, null, Collections.singletonList("SYSTEM TABLE")).get();
assertEquals(RequestStatus.OK, resp.getStatus());
List<TableMetadata> tables = resp.getTablesList();
assertEquals(22, tables.size());
verifyTable("information_schema", "CATALOGS", tables);
verifyTable("information_schema", "COLUMNS", tables);
verifyTable("information_schema", "SCHEMATA", tables);
verifyTable("information_schema", "TABLES", tables);
verifyTable("information_schema", "VIEWS", tables);
verifyTable("information_schema", "PARTITIONS", tables);
verifyTable("information_schema", "FILES", tables);
// Verify System Tables
for (SystemTable sysTbl : SystemTable.values()) {
verifyTable("sys", sysTbl.getTableName(), tables);
}
}
Aggregations