[CALCITE-7085] JOIN USING with unqualified common column fails in a conformance where allowQualifyingCommonColumn is false (e.g. Oracle, Presto)#4912
Conversation
…onformance where allowQualifyingCommonColumn is false (e.g. Oracle, Presto)
| new SqlIdentifier( | ||
| ImmutableList.of(child.name, name), | ||
| identifier.getParserPosition()); | ||
| SqlParserPos.ZERO); |
There was a problem hiding this comment.
This does not look like a robust way to carry information between compilation stages; in general, the parser position is best-effort in Calcite.
There must be a better way to do this. My intuition tells me that the unparser has to handle this case by stripping out the qualifying information. Alternatively, can the join type be changed to an INNER JOIN?
There was a problem hiding this comment.
Thank you for your suggestion. The original plan was indeed inadequate. I have now revised it to completely separate validation from expansion — validating the original AST once before expansion, and not performing validation during expansion.
There was a problem hiding this comment.
But why remove the position from the identifier?
…n column handling
|
mihaibudiu
left a comment
There was a problem hiding this comment.
This looks fine, but please address my two questions
| new SqlIdentifier( | ||
| ImmutableList.of(child.name, name), | ||
| identifier.getParserPosition()); | ||
| SqlParserPos.ZERO); |
There was a problem hiding this comment.
But why remove the position from the identifier?
| @Test void testJoinUsingWithConformanceOracle() { | ||
| final String sql = "SELECT deptno, name\n" | ||
| + "FROM emp JOIN dept using (deptno)"; | ||
| sql(sql).withConformance(SqlConformanceEnum.ORACLE_10).ok(); |
There was a problem hiding this comment.
do we have any tests which exercise the .fail()?



jira: https://issues.apache.org/jira/browse/CALCITE-7085