10
10
import org .antlr .v4 .runtime .Token ;
11
11
import org .antlr .v4 .runtime .tree .ParseTree ;
12
12
import org .antlr .v4 .runtime .tree .TerminalNode ;
13
- import org .elasticsearch .core .Booleans ;
14
13
import org .elasticsearch .common .Strings ;
14
+ import org .elasticsearch .core .Booleans ;
15
15
import org .elasticsearch .core .Tuple ;
16
16
import org .elasticsearch .xpack .ql .QlIllegalArgumentException ;
17
17
import org .elasticsearch .xpack .ql .expression .Alias ;
136
136
import static java .util .Collections .singletonList ;
137
137
import static org .elasticsearch .xpack .ql .parser .ParserUtils .source ;
138
138
import static org .elasticsearch .xpack .ql .parser .ParserUtils .text ;
139
+ import static org .elasticsearch .xpack .ql .parser .ParserUtils .typedParsing ;
139
140
import static org .elasticsearch .xpack .ql .parser .ParserUtils .visitList ;
140
141
import static org .elasticsearch .xpack .sql .type .SqlDataTypeConverter .canConvert ;
141
142
import static org .elasticsearch .xpack .sql .type .SqlDataTypeConverter .converterFor ;
@@ -154,7 +155,7 @@ abstract class ExpressionBuilder extends IdentifierBuilder {
154
155
}
155
156
156
157
protected Expression expression (ParseTree ctx ) {
157
- return typedParsing (ctx , Expression .class );
158
+ return typedParsing (this , ctx , Expression .class );
158
159
}
159
160
160
161
protected List <Expression > expressions (List <? extends ParserRuleContext > contexts ) {
@@ -407,7 +408,7 @@ public DataType visitPrimitiveDataType(PrimitiveDataTypeContext ctx) {
407
408
public Cast visitCastExpression (CastExpressionContext ctx ) {
408
409
CastTemplateContext castTc = ctx .castTemplate ();
409
410
if (castTc != null ) {
410
- return new Cast (source (castTc ), expression (castTc .expression ()), typedParsing (castTc .dataType (), DataType .class ));
411
+ return new Cast (source (castTc ), expression (castTc .expression ()), typedParsing (this , castTc .dataType (), DataType .class ));
411
412
} else {
412
413
ConvertTemplateContext convertTc = ctx .convertTemplate ();
413
414
DataType dataType = dataType (source (convertTc .dataType ()), convertTc .dataType ().getText ());
@@ -426,7 +427,7 @@ private static DataType dataType(Source ctx, String string) {
426
427
427
428
@ Override
428
429
public Object visitCastOperatorExpression (SqlBaseParser .CastOperatorExpressionContext ctx ) {
429
- return new Cast (source (ctx ), expression (ctx .primaryExpression ()), typedParsing (ctx .dataType (), DataType .class ));
430
+ return new Cast (source (ctx ), expression (ctx .primaryExpression ()), typedParsing (this , ctx .dataType (), DataType .class ));
430
431
}
431
432
432
433
@ Override
0 commit comments