[jira] [Commented] (CALCITE-5971) Add the RelRule to rewrite the bernoulli sample as Filter
[ https://issues.apache.org/jira/browse/CALCITE-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769890#comment-17769890 ] LakeShen commented on CALCITE-5971: --- Hi [~zhoujira86] ,it's ok for you to contribute to flink. > Add the RelRule to rewrite the bernoulli sample as Filter > -- > > Key: CALCITE-5971 > URL: https://issues.apache.org/jira/browse/CALCITE-5971 > Project: Calcite > Issue Type: New Feature > Components: core >Reporter: LakeShen >Assignee: LakeShen >Priority: Major > Labels: pull-request-available > Fix For: 1.36.0 > > > For the following SQL: > {code:java} > select deptno from "scott".dept tablesample bernoulli(50); {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand() < 0.5; {code} > The sql : > {code:java} > select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10); > {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand(10) < 0.5; {code} > This rule only rewrite the tablesample bernoulli,and this rule is like > presto/trino's > [ImplementBernoulliSampleAsFilter|https://github.com/prestodb/presto/blob/6eef062bdd3777936fa29127e728edde86a681d4/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ImplementBernoulliSampleAsFilter.java#L47C1-L48C35] > rule -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5971) Add the RelRule to rewrite the bernoulli sample as Filter
[ https://issues.apache.org/jira/browse/CALCITE-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769888#comment-17769888 ] xiaogang zhou commented on CALCITE-5971: [~shenlang] Hi Master, do you have a plan to contribute this issue to flink? otherwise I can take it > Add the RelRule to rewrite the bernoulli sample as Filter > -- > > Key: CALCITE-5971 > URL: https://issues.apache.org/jira/browse/CALCITE-5971 > Project: Calcite > Issue Type: New Feature > Components: core >Reporter: LakeShen >Assignee: LakeShen >Priority: Major > Labels: pull-request-available > Fix For: 1.36.0 > > > For the following SQL: > {code:java} > select deptno from "scott".dept tablesample bernoulli(50); {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand() < 0.5; {code} > The sql : > {code:java} > select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10); > {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand(10) < 0.5; {code} > This rule only rewrite the tablesample bernoulli,and this rule is like > presto/trino's > [ImplementBernoulliSampleAsFilter|https://github.com/prestodb/presto/blob/6eef062bdd3777936fa29127e728edde86a681d4/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ImplementBernoulliSampleAsFilter.java#L47C1-L48C35] > rule -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5971) Add the RelRule to rewrite the bernoulli sample as Filter
[ https://issues.apache.org/jira/browse/CALCITE-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768061#comment-17768061 ] LakeShen commented on CALCITE-5971: --- Could someone help me review this pr? > Add the RelRule to rewrite the bernoulli sample as Filter > -- > > Key: CALCITE-5971 > URL: https://issues.apache.org/jira/browse/CALCITE-5971 > Project: Calcite > Issue Type: New Feature > Components: core >Reporter: LakeShen >Assignee: LakeShen >Priority: Major > Fix For: 1.36.0 > > > For the following SQL: > {code:java} > select deptno from "scott".dept tablesample bernoulli(50); {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand() < 0.5; {code} > The sql : > {code:java} > select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10); > {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand(10) < 0.5; {code} > This rule only rewrite the tablesample bernoulli. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (CALCITE-5971) Add the RelRule to rewrite the bernoulli sample as Filter
[ https://issues.apache.org/jira/browse/CALCITE-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762713#comment-17762713 ] LakeShen commented on CALCITE-5971: --- This PR is Ready, PR link : https://github.com/apache/calcite/pull/3410 If others have time, please help me to review it, thank you very much:) > Add the RelRule to rewrite the bernoulli sample as Filter > -- > > Key: CALCITE-5971 > URL: https://issues.apache.org/jira/browse/CALCITE-5971 > Project: Calcite > Issue Type: New Feature > Components: core >Reporter: LakeShen >Assignee: LakeShen >Priority: Major > > For the following SQL: > {code:java} > select deptno from "scott".dept tablesample bernoulli(50); {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand() < 0.5; {code} > The sql : > {code:java} > select deptno from "scott".dept tablesample bernoulli(50) REPEATABLE(10); > {code} > We could rewrite it to: > {code:java} > select deptno from "scott".dept where rand(10) < 0.5; {code} > This rule only rewrite the tablesample bernoulli. -- This message was sent by Atlassian Jira (v8.20.10#820010)