@@ -87,8 +87,8 @@ private Aggregate aggregate(
87
87
Function <Rel , List <Aggregate .Measure >> measuresFn ,
88
88
Optional <Rel .Remap > remap ,
89
89
Rel input ) {
90
- var groupings = groupingsFn .apply (input );
91
- var measures = measuresFn .apply (input );
90
+ List < Aggregate . Grouping > groupings = groupingsFn .apply (input );
91
+ List < Aggregate . Measure > measures = measuresFn .apply (input );
92
92
return Aggregate .builder ()
93
93
.groupings (groupings )
94
94
.measures (measures )
@@ -147,7 +147,7 @@ public Filter filter(Function<Rel, Expression> conditionFn, Rel.Remap remap, Rel
147
147
148
148
private Filter filter (
149
149
Function <Rel , Expression > conditionFn , Optional <Rel .Remap > remap , Rel input ) {
150
- var condition = conditionFn .apply (input );
150
+ Expression condition = conditionFn .apply (input );
151
151
return Filter .builder ().input (input ).condition (condition ).remap (remap ).build ();
152
152
}
153
153
@@ -183,7 +183,7 @@ private Join join(
183
183
Optional <Rel .Remap > remap ,
184
184
Rel left ,
185
185
Rel right ) {
186
- var condition = conditionFn .apply (new JoinInput (left , right ));
186
+ Expression condition = conditionFn .apply (new JoinInput (left , right ));
187
187
return Join .builder ()
188
188
.left (left )
189
189
.right (right )
@@ -263,7 +263,7 @@ private NestedLoopJoin nestedLoopJoin(
263
263
Optional <Rel .Remap > remap ,
264
264
Rel left ,
265
265
Rel right ) {
266
- var condition = conditionFn .apply (new JoinInput (left , right ));
266
+ Expression condition = conditionFn .apply (new JoinInput (left , right ));
267
267
return NestedLoopJoin .builder ()
268
268
.left (left )
269
269
.right (right )
@@ -291,8 +291,8 @@ private NamedScan namedScan(
291
291
Iterable <String > columnNames ,
292
292
Iterable <Type > types ,
293
293
Optional <Rel .Remap > remap ) {
294
- var struct = Type .Struct .builder ().addAllFields (types ).nullable (false ).build ();
295
- var namedStruct = NamedStruct .of (columnNames , struct );
294
+ Type . Struct struct = Type .Struct .builder ().addAllFields (types ).nullable (false ).build ();
295
+ NamedStruct namedStruct = NamedStruct .of (columnNames , struct );
296
296
return NamedScan .builder ().names (tableName ).initialSchema (namedStruct ).remap (remap ).build ();
297
297
}
298
298
@@ -315,7 +315,7 @@ private Project project(
315
315
Function <Rel , Iterable <? extends Expression >> expressionsFn ,
316
316
Optional <Rel .Remap > remap ,
317
317
Rel input ) {
318
- var expressions = expressionsFn .apply (input );
318
+ Iterable <? extends Expression > expressions = expressionsFn .apply (input );
319
319
return Project .builder ().input (input ).expressions (expressions ).remap (remap ).build ();
320
320
}
321
321
@@ -332,7 +332,7 @@ private Expand expand(
332
332
Function <Rel , Iterable <? extends Expand .ExpandField >> fieldsFn ,
333
333
Optional <Rel .Remap > remap ,
334
334
Rel input ) {
335
- var fields = fieldsFn .apply (input );
335
+ Iterable <? extends Expand . ExpandField > fields = fieldsFn .apply (input );
336
336
return Expand .builder ().input (input ).fields (fields ).remap (remap ).build ();
337
337
}
338
338
@@ -363,7 +363,7 @@ private Sort sort(
363
363
Function <Rel , Iterable <? extends Expression .SortField >> sortFieldFn ,
364
364
Optional <Rel .Remap > remap ,
365
365
Rel input ) {
366
- var condition = sortFieldFn .apply (input );
366
+ Iterable <? extends Expression . SortField > condition = sortFieldFn .apply (input );
367
367
return Sort .builder ().input (input ).sortFields (condition ).remap (remap ).build ();
368
368
}
369
369
@@ -465,7 +465,7 @@ public Switch switchExpression(
465
465
466
466
public AggregateFunctionInvocation aggregateFn (
467
467
String namespace , String key , Type outputType , Expression ... args ) {
468
- var declaration =
468
+ SimpleExtension . AggregateFunctionVariant declaration =
469
469
extensions .getAggregateFunction (SimpleExtension .FunctionAnchor .of (namespace , key ));
470
470
return AggregateFunctionInvocation .builder ()
471
471
.arguments (Arrays .stream (args ).collect (java .util .stream .Collectors .toList ()))
@@ -477,7 +477,7 @@ public AggregateFunctionInvocation aggregateFn(
477
477
}
478
478
479
479
public Aggregate .Grouping grouping (Rel input , int ... indexes ) {
480
- var columns = fieldReferences (input , indexes );
480
+ List < FieldReference > columns = fieldReferences (input , indexes );
481
481
return Aggregate .Grouping .builder ().addAllExpressions (columns ).build ();
482
482
}
483
483
@@ -486,7 +486,7 @@ public Aggregate.Grouping grouping(Expression... expressions) {
486
486
}
487
487
488
488
public Aggregate .Measure count (Rel input , int field ) {
489
- var declaration =
489
+ SimpleExtension . AggregateFunctionVariant declaration =
490
490
extensions .getAggregateFunction (
491
491
SimpleExtension .FunctionAnchor .of (
492
492
DefaultExtensionCatalog .FUNCTIONS_AGGREGATE_GENERIC , "count:any" ));
@@ -563,7 +563,7 @@ public Aggregate.Measure sum0(Expression expr) {
563
563
private Aggregate .Measure singleArgumentArithmeticAggregate (
564
564
Expression expr , String functionName , Type outputType ) {
565
565
String typeString = ToTypeString .apply (expr .getType ());
566
- var declaration =
566
+ SimpleExtension . AggregateFunctionVariant declaration =
567
567
extensions .getAggregateFunction (
568
568
SimpleExtension .FunctionAnchor .of (
569
569
DefaultExtensionCatalog .FUNCTIONS_ARITHMETIC ,
@@ -585,7 +585,7 @@ private Aggregate.Measure singleArgumentArithmeticAggregate(
585
585
586
586
public Expression .ScalarFunctionInvocation negate (Expression expr ) {
587
587
// output type of negate is the same as the input type
588
- var outputType = expr .getType ();
588
+ Type outputType = expr .getType ();
589
589
return scalarFn (
590
590
DefaultExtensionCatalog .FUNCTIONS_ARITHMETIC ,
591
591
String .format ("negate:%s" , ToTypeString .apply (outputType )),
@@ -611,12 +611,12 @@ public Expression.ScalarFunctionInvocation divide(Expression left, Expression ri
611
611
612
612
private Expression .ScalarFunctionInvocation arithmeticFunction (
613
613
String fname , Expression left , Expression right ) {
614
- var leftTypeStr = ToTypeString .apply (left .getType ());
615
- var rightTypeStr = ToTypeString .apply (right .getType ());
616
- var key = String .format ("%s:%s_%s" , fname , leftTypeStr , rightTypeStr );
614
+ String leftTypeStr = ToTypeString .apply (left .getType ());
615
+ String rightTypeStr = ToTypeString .apply (right .getType ());
616
+ String key = String .format ("%s:%s_%s" , fname , leftTypeStr , rightTypeStr );
617
617
618
- var isOutputNullable = left .getType ().nullable () || right .getType ().nullable ();
619
- var outputType = left .getType ();
618
+ boolean isOutputNullable = left .getType ().nullable () || right .getType ().nullable ();
619
+ Type outputType = left .getType ();
620
620
outputType =
621
621
isOutputNullable
622
622
? TypeCreator .asNullable (outputType )
@@ -633,14 +633,14 @@ public Expression.ScalarFunctionInvocation equal(Expression left, Expression rig
633
633
public Expression .ScalarFunctionInvocation or (Expression ... args ) {
634
634
// If any arg is nullable, the output of or is potentially nullable
635
635
// For example: false or null = null
636
- var isOutputNullable = Arrays .stream (args ).anyMatch (a -> a .getType ().nullable ());
637
- var outputType = isOutputNullable ? N .BOOLEAN : R .BOOLEAN ;
636
+ boolean isOutputNullable = Arrays .stream (args ).anyMatch (a -> a .getType ().nullable ());
637
+ Type outputType = isOutputNullable ? N .BOOLEAN : R .BOOLEAN ;
638
638
return scalarFn (DefaultExtensionCatalog .FUNCTIONS_BOOLEAN , "or:bool" , outputType , args );
639
639
}
640
640
641
641
public Expression .ScalarFunctionInvocation scalarFn (
642
642
String namespace , String key , Type outputType , FunctionArg ... args ) {
643
- var declaration =
643
+ SimpleExtension . ScalarFunctionVariant declaration =
644
644
extensions .getScalarFunction (SimpleExtension .FunctionAnchor .of (namespace , key ));
645
645
return Expression .ScalarFunctionInvocation .builder ()
646
646
.declaration (declaration )
@@ -659,7 +659,7 @@ public Expression.WindowFunctionInvocation windowFn(
659
659
WindowBound lowerBound ,
660
660
WindowBound upperBound ,
661
661
Expression ... args ) {
662
- var declaration =
662
+ SimpleExtension . WindowFunctionVariant declaration =
663
663
extensions .getWindowFunction (SimpleExtension .FunctionAnchor .of (namespace , key ));
664
664
return Expression .WindowFunctionInvocation .builder ()
665
665
.declaration (declaration )
0 commit comments