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

hongyu guo commented on CALCITE-5184:
-------------------------------------

[~julianhyde]. Thank you for pointing out my problem, it will help me improve.


{color:#505f79}_The commit message is a bit unclear whether this is a bug of 
feature._{color}

I think this is a feature, not a bug. I change the commit message to 'Support 
"LIMIT start, ALL" in SQL Parser'

{color:#505f79}_Reference.md implies that “LIMIT ALL” is valid? Should it be? 
Either way, you should test it._{color}

“LIMIT ALL” is valid, you can see the test in 
[https://github.com/apache/calcite/blob/98f3048fb1407e2878162ffc80388d4f9dd094b2/testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java#L3698]

{color:#505f79}_You need some negative tests. If I use ALL in a conformance 
where it’s not supported, I should get an error._{color}

I add 2 negative tests
{code:sql}
select a from foo ^limit 2, all^
select a from foo ^offset 1 limit 2, all^
{code}

> In parser, allow "LIMIT start, ALL"
> -----------------------------------
>
>                 Key: CALCITE-5184
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5184
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: hongyu guo
>            Priority: Major
>              Labels: pull-request-available
>
> In parser, allow "LIMIT start, ALL". For example,
> {code:sql}
> SELECT *
> FROM Emp
> ORDER BY sal DESC
> LIMIT 10, ALL
> {code}
> would be equivalent to
> {code:sql}
> SELECT *
> FROM Emp
> ORDER BY sal DESC
> OFFSET 10
> {code}
> No other database supports this syntax, but Calcite supports Postgres' "LIMIT 
> ALL" and MySQL's "LIMIT start, count" so it makes sense to combine them.
> See the original discussion in CALCITE-5086.



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

Reply via email to