Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6413

SqlValidator does not invoke TypeCoercionImpl::binaryComparisonCoercion for both NATURAL and USING join conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.39.0
    • None

    Description

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

      1. Join condition ON expression

       @Test void test1() {
          final String sql = "select * from emp JOIN (VALUES ('XXX')) t(deptno)  ON emp.deptno = t.deptno";
          sql(sql).ok();
        }
      

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

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

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

      Attachments

        Issue Links

          Activity

            People

              mbudiu Mihai Budiu
              mzhuravkov Maksim Zhuravkov
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: