Ejemplo n.º 1
0
 @Test
 public void testListUnknownSchema() {
   assertNull(
       metadata.getTableHandle(
           SESSION, new SchemaTableName("totally_invalid_database_name", "dual")));
   assertEquals(metadata.listTables(SESSION, "totally_invalid_database_name"), ImmutableList.of());
   assertEquals(
       metadata.listTableColumns(
           SESSION, new SchemaTablePrefix("totally_invalid_database_name", "dual")),
       ImmutableMap.of());
 }
Ejemplo n.º 2
0
 @Test
 public void testListUnknownSchema() {
   assertNull(
       metadata.getTableHandle(SESSION, new SchemaTableName(INVALID_DATABASE, INVALID_TABLE)));
   assertEquals(metadata.listTables(SESSION, INVALID_DATABASE), ImmutableList.of());
   assertEquals(
       metadata.listTableColumns(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)),
       ImmutableMap.of());
   assertEquals(metadata.listViews(SESSION, INVALID_DATABASE), ImmutableList.of());
   assertEquals(
       metadata.getViews(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)),
       ImmutableMap.of());
 }
Ejemplo n.º 3
0
 private ConnectorTableHandle getTableHandle(SchemaTableName tableName) {
   ConnectorTableHandle handle = metadata.getTableHandle(SESSION, tableName);
   checkArgument(handle != null, "table not found: %s", tableName);
   return handle;
 }
 @Override
 public TableHandle getTableHandle(SchemaTableName tableName) {
   try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
     return delegate.getTableHandle(tableName);
   }
 }
Ejemplo n.º 5
0
 @Test
 public void testGetTableSchemaException() throws Exception {
   assertNull(metadata.getTableHandle(SESSION, invalidTable));
 }