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

Add the RelRule to rewrite the bernoulli sample as Filter

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.36.0
    • core

    Description

      For the following SQL:

      select deptno from "scott".dept tablesample bernoulli(50); 

      We could rewrite it to:

      select deptno from "scott".dept where rand() < 0.5;  

      The sql :

      select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10);  

      We could rewrite it to:

      select deptno from "scott".dept where rand(10) < 0.5;  

      This rule only rewrite the tablesample bernoulli,and this rule is like presto/trino's ImplementBernoulliSampleAsFilter rule

      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: