@@ -1165,19 +1165,19 @@ private void visitAggregation(
11651165 if (includeAggFieldsInNullFilter ) {
11661166 nonNullCandidates .addAll (
11671167 PlanUtils .getInputRefsFromAggCall (
1168- aggExprList .stream ().map (expr -> aggVisitor .analyze (expr , context )).toList ()));
1168+ aggExprList .stream ().map (expr -> aggVisitor .analyze (expr , context )).collect ( Collectors . toList () )));
11691169 nonNullGroupMask .set (groupExprList .size (), nonNullCandidates .size ());
11701170 }
11711171 List <RexNode > nonNullFields =
11721172 IntStream .range (0 , nonNullCandidates .size ())
11731173 .filter (nonNullGroupMask ::get )
11741174 .mapToObj (nonNullCandidates ::get )
1175- .toList ();
1175+ .collect ( Collectors . toList () );
11761176 context .relBuilder .filter (
11771177 PlanUtils .getSelectColumns (nonNullFields ).stream ()
11781178 .map (context .relBuilder ::field )
11791179 .map (context .relBuilder ::isNotNull )
1180- .toList ());
1180+ .collect ( Collectors . toList () ));
11811181
11821182 Pair <List <RexNode >, List <AggCall >> aggregationAttributes =
11831183 aggregateWithTrimming (groupExprList , aggExprList , context , toAddHintsOnAggregate );
@@ -1197,7 +1197,7 @@ private void visitAggregation(
11971197 .map (ref -> ref .getValueAs (String .class ))
11981198 .map (context .relBuilder ::field )
11991199 .map (f -> (RexNode ) f )
1200- .toList ();
1200+ .collect ( Collectors . toList () );
12011201 if (metricsFirst ) {
12021202 // As an example, in command `stats count() by colA, colB`,
12031203 // the sequence of output schema is "count, colA, colB".
@@ -2435,7 +2435,7 @@ public RelNode visitChart(Chart node, CalcitePlanContext context) {
24352435 ArgumentMap argMap = ArgumentMap .of (node .getArguments ());
24362436 ChartConfig config = ChartConfig .fromArguments (argMap );
24372437 List <UnresolvedExpression > groupExprList =
2438- Stream .of (node .getRowSplit (), node .getColumnSplit ()).filter (Objects ::nonNull ).toList ();
2438+ Stream .of (node .getRowSplit (), node .getColumnSplit ()).filter (Objects ::nonNull ).collect ( Collectors . toList () );
24392439 Aggregation aggregation =
24402440 new Aggregation (
24412441 List .of (node .getAggregationFunction ()), List .of (), groupExprList , null , List .of ());
@@ -2705,7 +2705,8 @@ public RelNode visitTimechart(
27052705 }
27062706
27072707 private String getAggFunctionName (UnresolvedExpression aggregateFunction ) {
2708- if (aggregateFunction instanceof Alias alias ) {
2708+ if (aggregateFunction instanceof Alias ) {
2709+ Alias alias = (Alias ) aggregateFunction ;
27092710 return getAggFunctionName (alias .getDelegated ());
27102711 }
27112712 return ((AggregateFunction ) aggregateFunction ).getFuncName ();
@@ -2932,12 +2933,18 @@ private RelNode buildZeroFilledResult(
29322933 */
29332934 private AggCall buildAggCall (
29342935 RelBuilder relBuilder , BuiltinFunctionName aggFunction , RexNode node ) {
2935- return switch (aggFunction ) {
2936- case MIN , EARLIEST -> relBuilder .min (node );
2937- case MAX , LATEST -> relBuilder .max (node );
2938- case AVG -> relBuilder .avg (node );
2939- default -> relBuilder .sum (node );
2940- };
2936+ switch (aggFunction ) {
2937+ case MIN :
2938+ case EARLIEST :
2939+ return relBuilder .min (node );
2940+ case MAX :
2941+ case LATEST :
2942+ return relBuilder .max (node );
2943+ case AVG :
2944+ return relBuilder .avg (node );
2945+ default :
2946+ return relBuilder .sum (node );
2947+ }
29412948 }
29422949
29432950 @ Override
0 commit comments