[ 
https://issues.apache.org/jira/browse/CALCITE-5912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17755692#comment-17755692
 ] 

Julian Hyde commented on CALCITE-5912:
--------------------------------------

I'm fine with skipping SYSTEM and just doing BERNOULLI.

Are you able to accomplish this as a logical rewrite? E.g. {{BERNOULLI(40 
REPEATABLE SEED 12345)}} &rarr; {{WHERE random(12345, 100) < 40}}. (I'm 
assuming there is a RANDOM function that takes a seed argument. I haven't 
checked.)

> Add an implementation of TABLESAMPLE in Enumerable convention
> -------------------------------------------------------------
>
>                 Key: CALCITE-5912
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5912
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: LakeShen
>            Assignee: LakeShen
>            Priority: Major
>
> In Calcite, the TableSample SQL statement will be converted to Sample RelNode 
> plan tree,for example:
> {code:java}
> select * from emp tablesample bernoulli(10){code}
> The plan is :
> {code:java}
> LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], 
> SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
>   Sample(mode=[bernoulli], rate=[10.0], repeatableSeed=[-])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> Currently in enumerable mode, we don't have EnumerableSample, So we can't add 
> TableSample quidem tests (such as in misc.iq).
> After this jira,we could add the quidem test for TableSample(such as 
> tablesample.iq),although TableSample's results are inconclusive when the 0 < 
> sample rate < 100, but TampeSample(0) is certain result.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to