You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Maksim Zhuravkov (Jira)" <ji...@apache.org> on 2024/05/21 14:42:00 UTC

[jira] [Created] (CALCITE-6413) SqlValidator does not invoke type coercion for both NATURAL and USING join conditions

Maksim Zhuravkov created CALCITE-6413:
-----------------------------------------

             Summary: SqlValidator does not invoke type coercion for both NATURAL and USING join conditions
                 Key: CALCITE-6413
                 URL: https://issues.apache.org/jira/browse/CALCITE-6413
             Project: Calcite
          Issue Type: Improvement
            Reporter: Maksim Zhuravkov


This can be observed by adding these test cases to `SqlToRelConverterTest`:

1. Join condition ON expression
{code:java}
 @Test void test1() {
    final String sql = "select * from emp JOIN (VALUES ('XXX')) t(deptno)  ON emp.deptno = t.deptno";
    sql(sql).ok();
  }
{code}

2. Common columns (USING/NATURAL) (since they both share the same code path for building join condition)

{code:java}
  @Test void test2() {
    final String sql = "select * from emp JOIN (VALUES ('XXX')) t(deptno)  USING (deptno)";
    sql(sql).ok();
  }
{code}

When test 1 runs, the SqlValidator calls TypeCoercionImpl::binaryComparisonCoercion
When test 2 runs, the SqlValidator does not call TypeCoercionImpl::binaryComparisonCoercion.


 





--
This message was sent by Atlassian Jira
(v8.20.10#820010)