twalthr commented on a change in pull request #18107:
URL: https://github.com/apache/flink/pull/18107#discussion_r769484337



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/SymbolArgumentTypeStrategy.java
##########
@@ -55,13 +55,15 @@ public SymbolArgumentTypeStrategy(Class<? extends Enum<? 
extends TableSymbol>> s
             }
         }
 
-        final SymbolType<?> symbolType = (SymbolType<?>) 
argumentType.getLogicalType();
-        if (symbolType.getSymbolClass() != symbolClass) {
+        if (!callContext.getArgumentValue(argumentPos, 
symbolClass).isPresent()) {
             if (throwOnFailure) {
                 throw callContext.newValidationError(
-                        "Unsupported argument symbol type. Expected symbol 
'%s' but actual symbol was '%s'.",
+                        "Unsupported argument symbol type. Expected symbol 
'%s' but actual symbol was %s.",
                         symbolClass.getSimpleName(),
-                        symbolType.getDefaultConversion().getSimpleName());
+                        callContext
+                                .getArgumentValue(argumentPos, Enum.class)

Review comment:
       `SymbolArgumentTypeStrategyTest` is testing this path. We are in control 
of creating symbols so we can safely assume an `Enum` here. Everything else is 
highly unlikely. For the `invalid` case I would need to create an invalid 
expression. The alternative would have been an `InvalidArgumentException`.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to