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

Unable to use SQL parameters for hive's EXECUTE OPTIMIZE commands #22660

Closed
curious-bug opened this issue Jul 12, 2024 · 2 comments
Closed

Unable to use SQL parameters for hive's EXECUTE OPTIMIZE commands #22660

curious-bug opened this issue Jul 12, 2024 · 2 comments

Comments

@curious-bug
Copy link

Trino Version: 380
Connector: Hive

I've run into an issue where trino/hive will not allow the use of the EXECUTE OPTIMIZE command with parameters.

When running the following from either my job scheduler of choice or manually in the CLI

PREPARE reshuffle FROM ALTER TABLE example_table EXECUTE OPTIMIZE WHERE value = ?
EXECUTE reshuffle USING 'some value'

I get this error message: Query __query_id__ failed: Incorrect number of parameters: expected 0 but found 1

However when I run just

ALTER TABLE example_table EXECUTE OPTIMIZE WHERE value = 'some value'

it executes just fine.

Running the prepare statement on its own yields no errors either. Trino seems to consume and prepare everything just fine.
Its only when attempting to execute it that the issue shows up.

While I can work around this issue in my specific application, this is strange behavior since the documentation (both for version 380 and the current release) says nothing about this and even implies that it should work.

@ebyhr
Copy link
Member

ebyhr commented Jul 12, 2024

Closing as duplicate of #18794

@ebyhr ebyhr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@curious-bug
Copy link
Author

While the mentioned issue contains a more in depth exploration of the issue, including a potential root cause identification and solution, it is also a year old and hasn't received any activity in that time.
I think this issue should remain open to help bring the problem back to the surface, otherwise it will never see the light of day again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants