use of io.trino.testing.TestingMetadata.TestingTableHandle in project trino by trinodb.
the class TestAnalyzer method testAnalysisDuplicateNames.
// This test validates object resolution order (materialized view, view and table).
// The order is arbitrary (connector should not return different object types with same name)
// and can be changed along with test.
@Test
public void testAnalysisDuplicateNames() {
// Materialized view redirects to "t1"
Analysis analysis = analyze("SELECT * FROM table_view_and_materialized_view");
TableHandle handle = getOnlyElement(analysis.getTables());
assertThat(((TestingTableHandle) handle.getConnectorHandle()).getTableName().getTableName()).isEqualTo("t1");
// View redirects to "t2"
analysis = analyze("SELECT * FROM table_and_view");
handle = getOnlyElement(analysis.getTables());
assertThat(((TestingTableHandle) handle.getConnectorHandle()).getTableName().getTableName()).isEqualTo("t2");
}
Aggregations