Skip to content

Conversation

@snleee
Copy link
Contributor

@snleee snleee commented Sep 11, 2023

Current implementation supports up to 5 boolean expressions. This improves to support up to 15 expressions.

@codecov-commenter
Copy link

Codecov Report

Merging #11566 (48f2d6b) into master (722f093) will increase coverage by 0.15%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master   #11566      +/-   ##
============================================
+ Coverage     62.94%   63.10%   +0.15%     
- Complexity     1106     1109       +3     
============================================
  Files          2325     2325              
  Lines        124772   124777       +5     
  Branches      19052    19052              
============================================
+ Hits          78534    78736     +202     
+ Misses        40625    40439     -186     
+ Partials       5613     5602      -11     
Flag Coverage Δ
integration <0.01% <0.00%> (ø)
integration1 <0.01% <0.00%> (ø)
integration2 0.00% <0.00%> (ø)
java-11 63.03% <0.00%> (+48.54%) ⬆️
java-17 62.93% <0.00%> (+48.43%) ⬆️
java-20 62.92% <0.00%> (+<0.01%) ⬆️
temurin 63.10% <0.00%> (+0.15%) ⬆️
unittests 63.09% <0.00%> (+0.15%) ⬆️
unittests1 67.45% <0.00%> (+0.17%) ⬆️
unittests2 14.53% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
.../pinot/common/function/scalar/ObjectFunctions.java 61.29% <0.00%> (-11.79%) ⬇️

... and 31 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@walterddr walterddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. can we add a test?

@snleee snleee force-pushed the support-larger-case-when-statements branch from 48f2d6b to d23ee17 Compare September 11, 2023 20:12
@snleee
Copy link
Contributor Author

snleee commented Sep 11, 2023

@walterddr Added the test.

@snleee snleee force-pushed the support-larger-case-when-statements branch from d23ee17 to 3610386 Compare September 11, 2023 20:39
@snleee snleee changed the title Support up to 10 boolean expressions for casewhen scalar function Support up to 15 boolean expressions for casewhen scalar function Sep 11, 2023
Current implementation supports up to 5 boolean expressions.
This improves to support up to 15 expressions.
@snleee snleee force-pushed the support-larger-case-when-statements branch from 3610386 to ee51f5a Compare September 11, 2023 20:40
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so ugly, but no easy solution lol..

Should we also add support for case-when without else?

@snleee
Copy link
Contributor Author

snleee commented Sep 12, 2023

The use case that I faced needs the else statement. If we don't cover else, we need to tweak by setting default value on the schema to cover else statement for that column. This will make things even more ugly.

@snleee snleee merged commit b297245 into apache:master Sep 12, 2023
@snleee snleee deleted the support-larger-case-when-statements branch September 12, 2023 00:05
@Jackie-Jiang
Copy link
Contributor

Jackie-Jiang commented Sep 12, 2023

@snleee When else is not configured, we should just return null. The existing caseWhen with var length arguments can already handle that

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants