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

TABLESAMPLE(0) should return empty result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.36.0
    • None

    Description

      For The sql:

      select * from emp tablesample bernoulli(0) where empno > 5
      

      The plan is :

      LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
        LogicalFilter(condition=[>($0, 5)])
          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      I think the correct result of above SQL is empty.

      But its result is the following SQL result:

      select * from emp where empno > 5
      

      It's an incorrect result

      Attachments

        Issue Links

          Activity

            People

              shenlang LakeShen
              shenlang LakeShen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: