Source:
<code>public JsonPostAggregation getJsonPostAggregation(String name, RexNode rexNode, RelNode rel) { if (rexNode instanceof RexCall) { List<JsonPostAggregation> fields = new ArrayList<>(); for (RexNode ele : ((RexCall) rexNode).getOperands()) { JsonPostAggregation field = getJsonPostAggregation("", ele, rel); if (field == null) { <START> return null; <END> } fields.add(field); } switch (rexNode.getKind()) { case PLUS: return new JsonArithmetic(name, "+", fields, null); case MINUS: return new JsonArithmetic(name, "-", fields, null); case DIVIDE: return new JsonArithmetic(name, "quotient", fields, null); case TIMES: return new JsonArithmetic(name, "*", fields, null); case CAST: return getJsonPostAggregation(name, ((RexCall) rexNode).getOperands().get(0), rel); default: } } else if (rexNode instanceof RexInputRef) { if (rel instanceof Aggregate) { Integer indexSkipGroup = ((RexInputRef) rexNode).getIndex() - ((Aggregate) rel).getGroupSet().cardinality(); AggregateCall aggCall = ((Aggregate) rel).getAggCallList().get(indexSkipGroup); if (aggCall.isDistinct() && aggCall.getAggregation().getKind().equals(SqlKind.COUNT)) { return new JsonHyperUniqueCardinality("", rel.getRowType().getFieldNames().get(((RexInputRef) rexNode).getIndex())); } } return new JsonFieldAccessor("", rel.getRowType().getFieldNames().get(((RexInputRef) rexNode).getIndex())); } else if (rexNode instanceof RexLiteral) { if (((RexLiteral) rexNode).getValue3() instanceof BigDecimal) { return new JsonConstant("", ((BigDecimal) ((RexLiteral) rexNode).getValue3()).doubleValue()); } } return null; }</code><technical_language>happened in order return null this method? This happen done checks before, right? If return null hit unexpected condition, please throw Exception. for return nulls in this method</technical_language>

Target:
public JsonPostAggregation getJsonPostAggregation(String name, RexNode rexNode, RelNode rel) { if (rexNode instanceof RexCall) { List<JsonPostAggregation> fields = new ArrayList<>(); for (RexNode ele : ((RexCall) rexNode).getOperands()) { JsonPostAggregation field = getJsonPostAggregation("", ele, rel); if (field == null) { throw new RuntimeException("Unchecked types that cannot be parsed as Post Aggregator"); } fields.add(field); } switch (rexNode.getKind()) { case PLUS: return new JsonArithmetic(name, "+", fields, null); case MINUS: return new JsonArithmetic(name, "-", fields, null); case DIVIDE: return new JsonArithmetic(name, "quotient", fields, null); case TIMES: return new JsonArithmetic(name, "*", fields, null); case CAST: return getJsonPostAggregation(name, ((RexCall) rexNode).getOperands().get(0), rel); default: } } else if (rexNode instanceof RexInputRef) { Integer indexSkipGroup = ((RexInputRef) rexNode).getIndex() - ((Aggregate) rel).getGroupCount(); AggregateCall aggCall = ((Aggregate) rel).getAggCallList().get(indexSkipGroup); if (aggCall.isDistinct() && aggCall.getAggregation().getKind().equals(SqlKind.COUNT)) { return new JsonHyperUniqueCardinality("", rel.getRowType().getFieldNames().get(((RexInputRef) rexNode).getIndex())); } return new JsonFieldAccessor("", rel.getRowType().getFieldNames().get(((RexInputRef) rexNode).getIndex())); } else if (rexNode instanceof RexLiteral) { if (((RexLiteral) rexNode).getValue3() instanceof BigDecimal) { return new JsonConstant("", ((BigDecimal) ((RexLiteral) rexNode).getValue3()).doubleValue()); } } throw new RuntimeException("Unchecked types that cannot be parsed as Post Aggregator"); }