Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse sql with expression in LIMIT clause #5097

Open
sunng87 opened this issue Dec 4, 2024 · 1 comment
Open

Failed to parse sql with expression in LIMIT clause #5097

sunng87 opened this issue Dec 4, 2024 · 1 comment
Labels
C-enhancement Category Enhancements

Comments

@sunng87
Copy link
Member

sunng87 commented Dec 4, 2024

What type of enhancement is this?

API improvement

What does the enhancement do?

To support SQL statement like:

SELECT 1 LIMIT 1::bigint

This is how postgres send limit clause to remote server when the original query contains a limit clause. Currently we got an error say:

ERROR:  Failed to plan SQL: Error during planning: Unexpected expression in LIMIT clause

Implementation challenges

No response

@sunng87 sunng87 added the C-enhancement Category Enhancements label Dec 4, 2024
@sunng87
Copy link
Member Author

sunng87 commented Dec 5, 2024

This issue has been fixed in datafusion 43 apache/datafusion#13028

sunng87 added a commit to sunng87/greptimedb that referenced this issue Dec 5, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 6, 2024
* feat: add sql parsers for cursor operations

* feat: cursor operator

* feat: implement RecordBatchStreamCursor

* feat: implement cursor storage and execution

* test: add tests

* chore: update docstring

* feat: add a temporary sql rewrite for cast in limit

this issue is described in #5097

* test: add more sql for cursor integration test

* feat: reject non-select query for cursor statement

* refactor: address review issues

* test: add empty result case

* feat: address review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements
Projects
None yet
Development

No branches or pull requests

1 participant