Search in sources :

Example 6 with GetTablesResp

use of org.apache.drill.exec.proto.UserProtos.GetTablesResp 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, Arrays.asList("SYSTEM_TABLE")).get();
    assertEquals(RequestStatus.OK, resp.getStatus());
    List<TableMetadata> tables = resp.getTablesList();
    assertEquals(11, 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("sys", "boot", tables);
    verifyTable("sys", "drillbits", tables);
    verifyTable("sys", "memory", tables);
    verifyTable("sys", "options", tables);
    verifyTable("sys", "threads", tables);
    verifyTable("sys", "version", tables);
}
Also used : TableMetadata(org.apache.drill.exec.proto.UserProtos.TableMetadata) GetTablesResp(org.apache.drill.exec.proto.UserProtos.GetTablesResp) Test(org.junit.Test)

Aggregations

GetTablesResp (org.apache.drill.exec.proto.UserProtos.GetTablesResp)6 TableMetadata (org.apache.drill.exec.proto.UserProtos.TableMetadata)6 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)1 List (java.util.List)1 MetaImpl (org.apache.calcite.avatica.MetaImpl)1 DrillPBError (org.apache.drill.exec.proto.UserBitShared.DrillPBError)1 LikeFilter (org.apache.drill.exec.proto.UserProtos.LikeFilter)1 RequestStatus (org.apache.drill.exec.proto.UserProtos.RequestStatus)1