abhioncbr commented on code in PR #11444:
URL: https://github.com/apache/pinot/pull/11444#discussion_r1306585847
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CaseTransformFunction.java:
##########
@@ -128,16 +129,22 @@ private void
constructStatementListLegacy(List<TransformFunction> arguments) {
for (int i = numWhenStatements; i < numWhenStatements * 2; i++) {
_thenStatements.add(arguments.get(i));
}
- if (arguments.size() % 2 != 0) {
+ if (arguments.size() % 2 != 0 &&
isNotNullLiteralTransformation(arguments.get(arguments.size() - 1))) {
_elseStatement = arguments.get(arguments.size() - 1);
}
}
private TransformResultMetadata calculateResultMetadata() {
- TransformResultMetadata elseStatementResultMetadata =
_elseStatement.getResultMetadata();
- DataType dataType = elseStatementResultMetadata.getDataType();
- Preconditions.checkState(elseStatementResultMetadata.isSingleValue(),
- "Unsupported multi-value expression in the ELSE clause");
+ DataType dataType;
Review Comment:
This change is required for supporting the NULL `_elseStatement`. Setting it
up as `DataType.UNKNOWN`
--
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]