Skip to content

fix: fix case when expr in db#2442

Merged
taozhi8833998 merged 1 commit intomasterfrom
fix-case-when-expr
May 30, 2025
Merged

fix: fix case when expr in db#2442
taozhi8833998 merged 1 commit intomasterfrom
fix-case-when-expr

Conversation

@taozhi8833998
Copy link
Copy Markdown
Owner

@taozhi8833998 taozhi8833998 added this to the 5.3.10 milestone May 28, 2025
@taozhi8833998 taozhi8833998 self-assigned this May 28, 2025
@taozhi8833998 taozhi8833998 added the bug Something isn't working label May 28, 2025
@cmlee-accelins
Copy link
Copy Markdown
Contributor

@taozhi8833998 I think array indexed functions could be in either the condition or the result of the case statement, for example:

SELECT CASE WHEN SPLIT('a-b', '-')[0] = 'a' THEN '1' ELSE '2' END FROM DUAL

and this looks like it only addresses the result in snowflake and postgres

@taozhi8833998
Copy link
Copy Markdown
Owner Author

@taozhi8833998 I think array indexed functions could be in either the condition or the result of the case statement, for example:

SELECT CASE WHEN SPLIT('a-b', '-')[0] = 'a' THEN '1' ELSE '2' END FROM DUAL

and this looks like it only addresses the result in snowflake and postgres

ok, support that, update the pr, add the test case

@taozhi8833998 taozhi8833998 merged commit 0a2f37a into master May 30, 2025
2 checks passed
@taozhi8833998 taozhi8833998 deleted the fix-case-when-expr branch May 30, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when expression with an array index is in a CASE expression

2 participants