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

Query with LEFT SEMI JOIN should not refer to RHS columns

    XMLWordPrintableJSON

Details

    Description

      A LEFT SEMI JOIN can only return columns from the left-hand table.
      But calcite also return both left-hand and right-hand table columns.

      In select.iq

      # LEFT SEMI JOIN (Hive only)
      SELECT *
      FROM emp LEFT SEMI JOIN dept ON emp.deptno = dept.deptno;
      
      SELECT "EMP"."EMPNO", "EMP"."ENAME", "EMP"."JOB", "EMP"."MGR", "EMP"."HIREDATE", "EMP"."SAL", "EMP"."COMM", "EMP"."DEPTNO", "DEPT"."DEPTNO" AS "DEPTNO0", "DEPT"."DNAME", "DEPT"."LOC"
      FROM "scott"."EMP" AS "EMP"
          LEFT SEMI JOIN "scott"."DEPT" AS "DEPT" ON "EMP"."DEPTNO" = "DEPT"."DEPTNO"
      !explain-validated-on hive
      

      Attachments

        Issue Links

          Activity

            People

              hongyuguo hongyu guo
              hongyuguo hongyu guo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: