siddharthteotia commented on a change in pull request #6908: URL: https://github.com/apache/incubator-pinot/pull/6908#discussion_r631985488
########## File path: pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java ########## @@ -107,7 +107,11 @@ public static Expression getLiteralExpression(SqlLiteral node) { Expression expression = new Expression(ExpressionType.LITERAL); Literal literal = new Literal(); if (node instanceof SqlNumericLiteral) { - if (((SqlNumericLiteral) node).isInteger()) { + // Mitigate calcite NPE bug, we need to check if SqlNumericLiteral.getScale() is null before calling + // SqlNumericLiteral.isInteger(). TODO: Undo this fix once a Calcite release that contains CALCITE-4199 is + // available and Pinot has been upgraded to use such a release. + SqlNumericLiteral sqlNumericLiteral = (SqlNumericLiteral) node; + if (sqlNumericLiteral.getScale() != null && sqlNumericLiteral.isInteger()) { Review comment: Will this condition ever evaluate to true assuming scale will be non null for decimal values and isInteger will be false ? -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org