Exemplo n.º 1
0
 @Test
 public void testHiveViewsHaveNoColumns() throws Exception {
   assertEquals(
       metadata.listTableColumns(
           SESSION, new SchemaTablePrefix(view.getSchemaName(), view.getTableName())),
       ImmutableMap.of());
 }
 @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());
 }
Exemplo n.º 3
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());
 }
 @Override
 public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(SchemaTablePrefix prefix) {
   try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
     return delegate.listTableColumns(prefix);
   }
 }