Add support for FETCH clause and FETCH FIRST WITH TIES clause#14871
Add support for FETCH clause and FETCH FIRST WITH TIES clause#14871fgwang7w wants to merge 5 commits intoprestodb:masterfrom
Conversation
|
Is this feature scheduled for next release? |
Thanks for reviewing. However, current commit only suppport FETCH syntax and OFFSET syntax. Add support for FETCH FIRST WITH TIES clause has not yet been committed. OFFSET implementation is still being worked on. |
9a1cbfd to
12f8494
Compare
|
@kaikalur I added the implementation for OFFSET and add support for FETCH FIRST WITH TIES clause. Could you please review again. I'd like to retain 2 commits as the 2nd commit contains the support for FETCH FIRST WITH TIES clause. Thanks. |
I'm OK with leaving |
Acutually |
d266b0e to
ec5bb8f
Compare
30bd260 to
476dae2
Compare
|
All tests fixed. Please help review the code for next release. Thanks! |
|
Was there code in this PR copied from another project? If so please follow the attribution guidelines. |
|
Just FYI it seems like 3/4 of the commits don't have a co-author tag. Thanks! |
commit msg is fixed |
|
@kaikalur had an LGTM on Jul 23, please review again. @tdcmeehan please help move forward for this PR. this has been waiting for too long to get merged since Jul 23 |
|
So I'm still confused - can we create 4 separate PRs? That'll be easier to review/track. |
I think it's already splitted into 4 commits which can be reviewed individually as Tim did. are you suggesting to split those 4 commits into 4 PRs now? |
I think that will be better. |
So chatted with Rongrong offline and it's ok to have just one PR with 4 commits. I will review them before Monday. |
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/rewrite/DescribeInputRewrite.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/com/facebook/presto/sql/analyzer/TestAnalyzer.java
Outdated
Show resolved
Hide resolved
|
Hi @fgwang7w can you please address the comments and update the PR ? We need OFFSET feature and hence we need this PR . Can you please fix the PR ? |
551906c to
9f8cd43
Compare
38247b8 to
da42dcb
Compare
d3b4a75 to
97b8737
Compare
Cherry-pick of trinodb/trino@a9e7145 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino315 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
Cherry-pick of trinodb/trino315 Co-authored-by: kasiafi <30203062+kasiafi@users.noreply.github.com>
kaikalur
left a comment
There was a problem hiding this comment.
I put a couple of comments. But my high level comment would be to keep this PR non-intrusive. I see a lot of core planner changes. I'm not sure why those are needed.
| new ImplementBernoulliSampleAsFilter(), | ||
| new ImplementOffset())), | ||
| new ImplementOffset(), | ||
| new ImplementLimitWithTies(metadata))), |
There was a problem hiding this comment.
We need this to be controlled by a session param/feature config. In fact, I would like the whole feature to be optional.
| { | ||
| if (!orderBy.isPresent() || (isSkipRedundantSort(session)) && analysis.isOrderByRedundant(orderBy.get())) { | ||
| return subPlan; | ||
| return Optional.empty(); |
There was a problem hiding this comment.
Why do we need this change?
|
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions! |
Syntax:
Extracted-From:
trinodb/trino#666
trinodb/trino#832
Test plan - Add UT and test locally