dawidwys commented on a change in pull request #8581:  [FLINK-12254][table] 
Update value literals to new type system
URL: https://github.com/apache/flink/pull/8581#discussion_r290600917
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/expressions/rules/ExpandColumnFunctionsRule.java
 ##########
 @@ -145,11 +145,9 @@ public 
ColumnsExpressionExpander(List<UnresolvedReferenceExpression> inputFieldR
 
                @Override
                public List<UnresolvedReferenceExpression> 
visitValueLiteral(ValueLiteralExpression valueLiteralExpression) {
-                       if (valueLiteralExpression.getType() instanceof 
IntegerTypeInfo) {
-                               return 
Collections.singletonList(inputFieldReferences.get((int) 
valueLiteralExpression.getValue() - 1));
-                       } else {
-                               return defaultMethod(valueLiteralExpression);
-                       }
+                       return 
ExpressionUtils.extractValue(valueLiteralExpression, Integer.class)
+                               .map((i) -> 
Collections.singletonList(inputFieldReferences.get(i - 1)))
 
 Review comment:
   nit: unnecessary parenthesis around `i`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to