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

Ethan Wang commented on PHOENIX-153:
------------------------------------

+1. After some study about _calcite/parse.jj_ and 
_calcite/SqlValidatorFeatureTest.java_, my understanding is that calcite seems 
to be very close to Postgres TABLESAMPLE syntax (which PHOENIX-153 is also 
designed to be similar with).

 I'd like to sum up two differences below (please correct me if I'm mistaken 
[~julianhyde]).

1, Calcite table sampling rate input is 0 to 100 (PHOENIX-153 currently is 0 to 
1).
2,  Syntax difference
Calcite:  select name from dept TABLESAMPLE system(58)
PHOENIX-153: select name from dept TABLESAMPLE 0.58 

Purposing change for PHOENIX-153: Let's change phoenix side to be
select name from dept TABLESAMPLE(0.58) 

Thoughts?




Reference:
https://github.com/apache/calcite/blob/d619304070bf2874ab760c92ec2573ee6c19f536/piglet/src/main/javacc/PigletParser.jj

https://github.com/apache/calcite/blob/0938c7b6d767e3242874d87a30d9112512d9243a/core/src/test/java/org/apache/calcite/test/SqlValidatorFeatureTest.java

> Implement TABLESAMPLE clause
> ----------------------------
>
>                 Key: PHOENIX-153
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-153
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Ethan Wang
>              Labels: enhancement
>
> Support the standard SQL TABLESAMPLE clause by implementing a filter that 
> uses a skip next hint based on the region boundaries of the table to only 
> return n rows per region.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to