Fix NPE in gap-fill when order-by is not specified
@@ -304,7 +304,9 @@ public class GapfillUtils {
}
}
- for (Expression orderBy : strippedPinotQuery.getOrderByList()) {
+ List<Expression> orderByList = strippedPinotQuery.getOrderByList();
+ if (orderByList != null) {
+ for (Expression orderBy : orderByList) {
if (orderBy.getType() != ExpressionType.FUNCTION) {
continue;
}
@@ -315,6 +317,7 @@ public class GapfillUtils {
break;
}
}
+ }
strippedPinotQuery.setQueryOptions(queryOptions);
strippedPinotQuery.setDebugOptions(debugOptions);
