use of org.apache.calcite.rel.metadata.RelColumnOrigin in project calcite by apache.
the class RelMetadataTest method checkTwoColumnOrigin.
// WARNING: this requires the two table names to be different
private void checkTwoColumnOrigin(String sql, String expectedTableName1, String expectedColumnName1, String expectedTableName2, String expectedColumnName2, boolean expectedDerived) {
Set<RelColumnOrigin> result = checkColumnOrigin(sql);
assertTrue(result != null);
assertEquals(2, result.size());
for (RelColumnOrigin rco : result) {
RelOptTable actualTable = rco.getOriginTable();
List<String> actualTableName = actualTable.getQualifiedName();
String actualUnqualifiedName = Iterables.getLast(actualTableName);
if (actualUnqualifiedName.equals(expectedTableName1)) {
checkColumnOrigin(rco, expectedTableName1, expectedColumnName1, expectedDerived);
} else {
checkColumnOrigin(rco, expectedTableName2, expectedColumnName2, expectedDerived);
}
}
}
Aggregations