Skip to content

Conversation

@gatorsmile
Copy link
Member

What changes were proposed in this pull request?

LIMIT ALL is the same as omitting the LIMIT clause. It is supported by both PrestgreSQL and Presto. This PR is to support it by adding it in the parser.

How was this patch tested?

Added a test case

@SparkQA
Copy link

SparkQA commented May 12, 2017

Test build #76847 has started for PR 17960 at commit b4a4b0a.

select * from testdata limit 2;
select * from arraydata limit 2;
select * from mapdata limit 2;
SELECT * FROM testdata LIMIT 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wonder why these should be upper-cased just for curiosity. Is this way preferred?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is preferred. All the SQL keywords are preferred to use the upper case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you.

}.getMessage
assert(e.contains(expected))
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. This was duplicated.

@dongjoon-hyun
Copy link
Member

Retest this please.

@dongjoon-hyun
Copy link
Member

+1, LGTM.

@SparkQA
Copy link

SparkQA commented May 12, 2017

Test build #76873 has finished for PR 17960 at commit b4a4b0a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

withWindow.optional(limit) {
Limit(typedVisit(limit), withWindow)
if (ALL != null) {
// LIMIT ALL is the same as omitting the LIMIT clause
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be true? I don't think you need to check ALL if limit != null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Thank you!

@SparkQA
Copy link

SparkQA commented May 12, 2017

Test build #76881 has finished for PR 17960 at commit a15770b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@hvanhovell
Copy link
Contributor

LGTM - merging to master. Thanks!

@asfgit asfgit closed this in b84ff7e May 12, 2017
robert3005 pushed a commit to palantir/spark that referenced this pull request May 19, 2017
### What changes were proposed in this pull request?
`LIMIT ALL` is the same as omitting the `LIMIT` clause. It is supported by both PrestgreSQL and Presto. This PR is to support it by adding it in the parser.

### How was this patch tested?
Added a test case

Author: Xiao Li <[email protected]>

Closes apache#17960 from gatorsmile/LimitAll.
liyichao pushed a commit to liyichao/spark that referenced this pull request May 24, 2017
### What changes were proposed in this pull request?
`LIMIT ALL` is the same as omitting the `LIMIT` clause. It is supported by both PrestgreSQL and Presto. This PR is to support it by adding it in the parser.

### How was this patch tested?
Added a test case

Author: Xiao Li <[email protected]>

Closes apache#17960 from gatorsmile/LimitAll.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants