File tree Expand file tree Collapse file tree
core/src/main/java/org/opensearch/sql/calcite Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1137,13 +1137,12 @@ private void visitAggregation(
11371137 }
11381138 groupExprList .addAll (node .getGroupExprList ());
11391139
1140- // add stats hint to LogicalAggregation
1140+ // Add stats hint to LogicalAggregation.
11411141 boolean toAddHintsOnAggregate =
1142- nonNullGroupMask .nextClearBit (0 )
1143- >= groupExprList .size () // This checks if all group-bys should be nonnull
1144- && !groupExprList .isEmpty ()
1145- && !(groupExprList .size () == 1 && getTimeSpanField (span ).isPresent ());
1146- // add isNotNull filter before aggregation for non-nullable buckets
1142+ !groupExprList .isEmpty ()
1143+ // This checks if all group-bys should be nonnull
1144+ && nonNullGroupMask .nextClearBit (0 ) >= groupExprList .size ();
1145+ // Add isNotNull filter before aggregation for non-nullable buckets
11471146 List <RexNode > groupByList =
11481147 groupExprList .stream ().map (expr -> rexVisitor .analyze (expr , context )).toList ();
11491148 List <RexNode > nonNullGroupBys =
You can’t perform that action at this time.
0 commit comments