JingsongLi commented on a change in pull request #64:
URL: https://github.com/apache/flink-table-store/pull/64#discussion_r836056777



##########
File path: 
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/predicate/PredicateConverter.java
##########
@@ -131,22 +139,28 @@ private Predicate visitBiFunction(
         return Optional.empty();
     }
 
-    private Optional<Literal> extractLiteral(Expression expression) {
+    private Optional<Literal> extractLiteral(DataType expectedType, Expression 
expression) {
+        Literal literal = null;
         if (expression instanceof ValueLiteralExpression) {
             ValueLiteralExpression valueExpression = (ValueLiteralExpression) 
expression;
-            DataType type = valueExpression.getOutputDataType();
-            return supportsPredicate(type.getLogicalType())
-                    ? Optional.of(
-                            new Literal(
-                                    type.getLogicalType(),
-                                    getConverter(type)
-                                            .toInternalOrNull(
-                                                    valueExpression
-                                                            
.getValueAs(type.getConversionClass())
-                                                            .get())))
-                    : Optional.empty();
+            LogicalType expectedLogicalType = expectedType.getLogicalType();
+            DataType actualType = valueExpression.getOutputDataType();
+            LogicalType actualLogicalType = actualType.getLogicalType();
+            DataStructureConverter<Object, Object> converter = 
getConverter(expectedType);
+            Object value = 
valueExpression.getValueAs(actualType.getConversionClass()).get();
+            if (!actualLogicalType.equals(expectedLogicalType)

Review comment:
       Use `LogicalTypeRoot` equals.




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to