sdk2 commented on code in PR #69404:
URL: https://github.com/apache/doris/pull/69404#discussion_r4799763517


##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveWritePlanProvider.java:
##########
@@ -351,6 +353,32 @@ private List<THivePartition> 
buildExistingPartitions(HmsTableInfo table) {
         return partitions;
     }
 
+    private static Optional<String> fullyStaticPartitionName(HmsTableInfo 
table, ConnectorWriteHandle handle) {
+        // Typed partition text can differ between FE literals and BE 
directory formatting (e.g. BOOLEAN
+        // true versus 1). Narrow only string partitions, whose cast values 
are the bytes BE will write.
+        for (ConnectorColumn column : table.getPartitionKeys()) {
+            String type = column.getType().getTypeName();
+            if (!"STRING".equalsIgnoreCase(type) && 
!"VARCHAR".equalsIgnoreCase(type)
+                    && !"CHAR".equalsIgnoreCase(type)) {
+                return Optional.empty();
+            }
+        }
+        Map<String, String> spec = new 
TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+        spec.putAll(handle.getCastStaticPartitionSpec());

Review Comment:
   Done: completeness is now decided from `getStaticPartitionSpec` and 
`getStaticPartitionNullKeys` before `getCastStaticPartitionSpec` is called, so 
a mixed static/dynamic write never evaluates a cast. If the FE cannot evaluate 
a fully static cast, the full listing is kept and BE handles the row value. The 
catch now rethrows NPE / IllegalStateException / ClassCastException and logs 
the expected fallback at debug. Added a binding-failure test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to