use of org.apache.drill.exec.store.sys.SystemTable in project drill by apache.
the class TestMetadataProvider method tablesWithTableNameFilter.
@Test
public void tablesWithTableNameFilter() throws Exception {
// test("SELECT * FROM INFORMATION_SCHEMA.`TABLES` WHERE TABLE_NAME LIKE '%o%'"); // SQL equivalent
GetTablesResp resp = client.getTables(null, null, LikeFilter.newBuilder().setPattern("%o%").build(), null).get();
assertEquals(RequestStatus.OK, resp.getStatus());
List<TableMetadata> tables = resp.getTablesList();
assertEquals(12, tables.size());
// Verify System Tables
for (SystemTable sysTbl : SystemTable.values()) {
String sysTblName = sysTbl.getTableName();
if (sysTblName.contains("o")) {
verifyTable("sys", sysTblName, tables);
}
}
}
use of org.apache.drill.exec.store.sys.SystemTable 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.store.sys.SystemTable 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