JingsongLi commented on a change in pull request #10371: [FLINK-14953][formats] 
use table type to build parquet FilterPredicate
URL: https://github.com/apache/flink/pull/10371#discussion_r353520817
 
 

 ##########
 File path: 
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetTableSource.java
 ##########
 @@ -465,6 +479,10 @@ private String getColumnName(BinaryComparison comp) {
                        typeInfo == BasicTypeInfo.INT_TYPE_INFO) {
                        return new Tuple2<>(FilterApi.intColumn(columnName), 
(Integer) value);
                } else if (typeInfo == BasicTypeInfo.LONG_TYPE_INFO) {
+                       if (value instanceof Integer) {
+                               Integer intValue = (Integer) value;
+                               return new 
Tuple2<>(FilterApi.longColumn(columnName), intValue.longValue());
+                       }
                        return new Tuple2<>(FilterApi.longColumn(columnName), 
(Long) value);
 
 Review comment:
   You should just use `((Number) value).longValue()`.
   For other types, we should modify too.

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