This is an automated email from the ASF dual-hosted git repository. siddteotia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push: new 6e6e0a4e86 Fix NPE in gap-fill when order-by is not specified (#9250) 6e6e0a4e86 is described below commit 6e6e0a4e86918e1b73491ffe0e177745db7645fe Author: Xiaotian (Jackie) Jiang <17555551+jackie-ji...@users.noreply.github.com> AuthorDate: Fri Aug 19 13:06:41 2022 -0700 Fix NPE in gap-fill when order-by is not specified (#9250) --- .../org/apache/pinot/core/util/GapfillUtils.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pinot-core/src/main/java/org/apache/pinot/core/util/GapfillUtils.java b/pinot-core/src/main/java/org/apache/pinot/core/util/GapfillUtils.java index 2a7b90d405..aca1a435b3 100644 --- a/pinot-core/src/main/java/org/apache/pinot/core/util/GapfillUtils.java +++ b/pinot-core/src/main/java/org/apache/pinot/core/util/GapfillUtils.java @@ -304,15 +304,18 @@ public class GapfillUtils { } } - for (Expression orderBy : strippedPinotQuery.getOrderByList()) { - if (orderBy.getType() != ExpressionType.FUNCTION) { - continue; - } - if (orderBy.getFunctionCall().getOperands().get(0).getType() == ExpressionType.FUNCTION && GAP_FILL.equals( - orderBy.getFunctionCall().getOperands().get(0).getFunctionCall().getOperator())) { - orderBy.getFunctionCall().getOperands() - .set(0, orderBy.getFunctionCall().getOperands().get(0).getFunctionCall().getOperands().get(0)); - break; + List<Expression> orderByList = strippedPinotQuery.getOrderByList(); + if (orderByList != null) { + for (Expression orderBy : orderByList) { + if (orderBy.getType() != ExpressionType.FUNCTION) { + continue; + } + if (orderBy.getFunctionCall().getOperands().get(0).getType() == ExpressionType.FUNCTION && GAP_FILL.equals( + orderBy.getFunctionCall().getOperands().get(0).getFunctionCall().getOperator())) { + orderBy.getFunctionCall().getOperands() + .set(0, orderBy.getFunctionCall().getOperands().get(0).getFunctionCall().getOperands().get(0)); + break; + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org