Jackie-Jiang commented on code in PR #11395:
URL: https://github.com/apache/pinot/pull/11395#discussion_r1299490599
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CaseTransformFunction.java:
##########
@@ -331,7 +331,7 @@ protected int[] transformToIntValuesSVUsingValue(ValueBlock
valueBlock) {
}
}
if (!unselectedDocs.isEmpty()) {
- if (_elseStatement == null) {
+ if (_elseStatement == null ||
LiteralTransformFunction.isNullLiteralTransform(_elseStatement)) {
Review Comment:
To simplify this, we can change `constructStatementListCalcite()` (also
change `constructStatementListLegacy()` for backward compatible) to set
`_elseStatement` to `null` when it is null literal
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/LiteralTransformFunction.java:
##########
@@ -269,4 +277,15 @@ public RoaringBitmap getNullBitmap(ValueBlock valueBlock) {
bitmap.add(0L, length);
return bitmap;
}
+
+ /*
+ * Util function to check whether the Literal transform is null or not.
+ */
+ public static boolean isNullLiteralTransform(TransformFunction function) {
Review Comment:
Suggest adding `boolean isNull()` instead. Checking `_dataType` itself
should be enough (consistent with `getNullBitmap()`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]