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

Ensure Parameters are in proper order for queries having WITH clause #17012

Closed
rubenssoto opened this issue Nov 17, 2021 · 0 comments · Fixed by #17083
Closed

Ensure Parameters are in proper order for queries having WITH clause #17012

rubenssoto opened this issue Nov 17, 2021 · 0 comments · Fixed by #17083
Labels

Comments

@rubenssoto
Copy link

Hello Everyone,

I am having a bug with Presto and Prepare statement.

I run the following prepare statement:

PREPARE statement1 FROM 
with t1 as (select * 
from database.fact_order
join database.dim_poc
on database.dim_poc.poc_id = database.fact_order.poc_id
where "database"."dim_poc"."poc_category" IN (?)
and database.fact_order.poc_id = ?)
select * from t1
where created_date_brt = ?
limit 10

A normal behavior is to have something like that on Execution phase:

EXECUTE statement1 USING 'BAR', 1234, DATE '2021-11-16'

But PrestoDb Expected the wrong order:

EXECUTE statement1 USING DATE '2021-11-16', 'BAR', 1234

This bug is related to the same bug on Trino
trinodb/trino#1191

Trino has a PR to solve the problem:
trinodb/trino#1529

thank you

v-jizhang added a commit to v-jizhang/presto that referenced this issue Feb 24, 2022
Cherry-pick of trinodb/trino#1529

Fixes prestodb#17012

Co-authored-by: praveenkrishna <praveenkrishna@tutanota.com>
zhenxiao pushed a commit that referenced this issue Mar 1, 2022
Cherry-pick of trinodb/trino#1529

Fixes #17012

Co-authored-by: praveenkrishna <praveenkrishna@tutanota.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants