bowenli86 commented on a change in pull request #9088: [FLINK-13012][hive] 
Handle default partition name of Hive table
URL: https://github.com/apache/flink/pull/9088#discussion_r304010187
 
 

 ##########
 File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/batch/connectors/hive/HiveTableSource.java
 ##########
 @@ -160,7 +162,14 @@ private void initAllPartitions() {
                                                String partitionValue = 
partition.getValues().get(i);
                                                
partitionSpec.put(partitionColName, partitionValue);
                                                DataType type = 
catalogTable.getSchema().getFieldDataType(partitionColName).get();
-                                               Object partitionObject = 
restorePartitionValueFromFromType(partitionValue, type);
+                                               Object partitionObject;
+                                               if 
(defaultPartitionName.equals(partitionValue)) {
+                                                       LogicalTypeRoot 
typeRoot = type.getLogicalType().getTypeRoot();
+                                                       // while this is inline 
with Hive, seems it should be null for string columns as well?
+                                                       partitionObject = 
typeRoot == LogicalTypeRoot.CHAR || typeRoot == LogicalTypeRoot.VARCHAR ? 
defaultPartitionName : null;
 
 Review comment:
   Wondering why partitionObject will be null if the type root is not 
char/varchar?

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