Skip to content

Conversation

@bhavnajindal
Copy link

@bhavnajindal bhavnajindal commented Aug 9, 2023

Issue: https://github.ibm.com/ClickHouse/issue-repo/issues/3091

Changelog category (leave one):

  • Improvement

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:

SELECT *
FROM
(
    SELECT custom_prop_value[1] AS Column1
    FROM events
    LIMIT 1
)

@bhavnajindal bhavnajindal requested a review from kashwy August 9, 2023 20:30
@bkuschel
Copy link
Member

bkuschel commented Aug 9, 2023

This is an automated comment for commit ef5abbf with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🔴 failure

Check nameDescriptionStatus
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report🔴 failure

Copy link

@kashwy kashwy left a 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"
Copy link

@kashwy kashwy Aug 11, 2023

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?

Copy link
Author

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.

Copy link

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

@bhavnajindal bhavnajindal requested a review from kashwy August 15, 2023 13:48
@bhavnajindal bhavnajindal merged commit d2d528d into Kusto-phase3 Aug 17, 2023
kashwy pushed a commit that referenced this pull request Sep 19, 2023
…382)

* fix-3091 added simple mapping for constatnt expressions

* fixed unit tests

* added testcase for negetive array index
kothiga pushed a commit that referenced this pull request Dec 9, 2023
…382)

* fix-3091 added simple mapping for constatnt expressions

* fixed unit tests

* added testcase for negetive array index
kothiga pushed a commit that referenced this pull request Jan 11, 2024
…382)

* fix-3091 added simple mapping for constatnt expressions

* fixed unit tests

* added testcase for negetive array index
kothiga pushed a commit that referenced this pull request Mar 7, 2024
…382)

* fix-3091 added simple mapping for constatnt expressions

* fixed unit tests

* added testcase for negetive array index
SuzyWangIBMer pushed a commit that referenced this pull request Apr 11, 2024
…382)

* fix-3091 added simple mapping for constatnt expressions

* fixed unit tests

* added testcase for negetive array index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants