-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix-3091 added simple mapping for constatnt expressions #382
Conversation
This is an automated comment for commit ef5abbf with description of existing statuses. It's updated for the latest CI running
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some test cases of negative index
}, | ||
{ | ||
"print A[B[1]]", | ||
"SELECT A[if((B[if(1 >= 0, 1 + 1, 1)]) >= 0, (B[if(1 >= 0, 1 + 1, 1)]) + 1, B[if(1 >= 0, 1 + 1, 1)])] AS print_0" | ||
"SELECT A[if((B[2]) >= 0, (B[2]) + 1, B[2])] AS print_0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this recursive case be solved too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to get the value of B[2] to correctly map it, which isn't available during Parsing. Therefore, treating B[2] as an arbitrary expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to get the value of B[2] to correctly map it, which isn't available during Parsing. Therefore, treating B[2] as an arbitrary expression.
ok, that's good
…382) * fix-3091 added simple mapping for constatnt expressions * fixed unit tests * added testcase for negetive array index
…382) * fix-3091 added simple mapping for constatnt expressions * fixed unit tests * added testcase for negetive array index
…382) * fix-3091 added simple mapping for constatnt expressions * fixed unit tests * added testcase for negetive array index
…382) * fix-3091 added simple mapping for constatnt expressions * fixed unit tests * added testcase for negetive array index
…382) * fix-3091 added simple mapping for constatnt expressions * fixed unit tests * added testcase for negetive array index
Issue: https://github.ibm.com/ClickHouse/issue-repo/issues/3091
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Requirement was to add a direct mapping without using expression inside the array. Therefore, now computing the index first and then passing it to CH SQL only for constant numerical expressions.
Query:
select * from kql(events | project custom_prop_value[0] | take 1)
Output: