morningman commented on code in PR #58033:
URL: https://github.com/apache/doris/pull/58033#discussion_r2536947592


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java:
##########
@@ -609,11 +609,44 @@ public static Type 
icebergTypeToDorisType(org.apache.iceberg.types.Type type) {
         }
     }
 
-    public static Map<String, String> getPartitionInfoMap(PartitionData 
partitionData, String timeZone) {
+    /**
+     * Get partition info map for identity partitions only, considering 
partition
+     * evolution.
+     * For non-identity partitions (e.g., day, bucket, truncate), returns null 
to
+     * skip
+     * dynamic partition pruning.
+     *
+     * @param partitionData The partition data from the file
+     * @param partitionSpec The partition spec corresponding to the file's 
specId
+     *                      (required)
+     * @param timeZone      The time zone for timestamp serialization
+     * @return Map of partition field name to partition value string, or null 
if
+     *         there are non-identity partitions
+     */
+    public static Map<String, String> getPartitionInfoMap(PartitionData 
partitionData, PartitionSpec partitionSpec,
+            String timeZone) {
         Map<String, String> partitionInfoMap = new HashMap<>();
         List<NestedField> fields = 
partitionData.getPartitionType().asNestedType().fields();
+
+        // Check if all partition fields are identity transform
+        // If any field is not identity, return null to skip dynamic partition 
pruning
+        List<PartitionField> partitionFields = partitionSpec.fields();
+        Preconditions.checkArgument(fields.size() == partitionFields.size(),
+                "PartitionData fields size does not match PartitionSpec fields 
size");
+
         for (int i = 0; i < fields.size(); i++) {
             NestedField field = fields.get(i);
+            PartitionField partitionField = partitionFields.get(i);
+
+            // Only process identity transform partitions
+            // For other transforms (day, bucket, truncate, etc.), skip 
dynamic partition
+            // pruning
+            if (!partitionField.transform().isIdentity()) {
+                LOG.debug("Skipping dynamic partition pruning for non-identity 
partition field: {} with transform: {}",

Review Comment:
   Add `if (LOG.isDebugEnable())`



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