[
https://issues.apache.org/jira/browse/DRILL-8090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467993#comment-17467993
]
ASF GitHub Bot commented on DRILL-8090:
---------------------------------------
vvysotskyi opened a new pull request #2420:
URL: https://github.com/apache/drill/pull/2420
# [DRILL-8090](https://issues.apache.org/jira/browse/DRILL-8090): LIMIT
clause is pushed down to an invalid OFFSET-FETCH clause for MS SQL Server
## Description
- Updated Calcite fork version to include
https://github.com/apache/calcite/commit/cc40a48cb8ca16f91bfdc66eaed6151805355d4b,
so now regular limit can be pushed down to MS SQL as `TOP N` instead of
`FETCH`.
- Updated `JdbcLimitRule` and `JdbcSortRule` to prevent pushing down `FETCH`
with `OFFSET` and without `ORDER BY`.
For such a case, some rules at the physical stage will generate a limit on
top of the scan that includes `FETCH` only and another limit with `FETCH` and
`OFFSET` above, so the limit will be pushed down.
- Allowed matching JDBC rules for physical rel nodes.
- Fixed issue with ClassCastException for Phoenix plugin (issue similar to
DRILL-7972).
## Documentation
NA
## Testing
Checked manually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
> LIMIT clause is pushed down to an invalid OFFSET-FETCH clause for MS SQL
> Server
> --------------------------------------------------------------------------------
>
> Key: DRILL-8090
> URL: https://issues.apache.org/jira/browse/DRILL-8090
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.19.0
> Reporter: James Turton
> Assignee: Vova Vysotskyi
> Priority: Major
>
> In MS SQL Server, ORDER BY is mandatory for using OFFSET and FETCH clauses.
> Drill (or Calcite) does not include an ORDER BY clause in the SQL it
> generates for a LIMIT clause.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)