zhaorongsheng commented on code in PR #67725:
URL: https://github.com/apache/doris/pull/67725#discussion_r4255904584


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/plugin/PluginDrivenExternalTable.java:
##########
@@ -969,12 +1012,24 @@ public Map<String, PartitionItem> 
getNameToPartitionItems(Optional<MvccSnapshot>
             return Collections.emptyMap();
         }
 
-        // One round-trip, no FE-side partition-value cache (per CACHE-P1: the 
cutover lists
-        // partitions per query instead of maintaining a second-level cache). 
The connector returns
-        // each partition's display name plus a raw-keyed value map; we 
extract values in
-        // partition-column order via the cached remote names.
-        List<ConnectorPartitionInfo> partitions =
-                metadata.listPartitions(session, handleOpt.get(), 
Optional.empty());
+        return buildNameToPartitionItems(snapshot, metadata, session, 
handleOpt.get(), partitionColumns,
+                partitionFilter);
+    }
+
+    private Map<String, PartitionItem> 
buildNameToPartitionItems(Optional<MvccSnapshot> snapshot,
+            ConnectorMetadata metadata, ConnectorSession session, 
ConnectorTableHandle handle,
+            List<Column> partitionColumns) {
+        return buildNameToPartitionItems(snapshot, metadata, session, handle, 
partitionColumns, Optional.empty());
+    }
+
+    private Map<String, PartitionItem> 
buildNameToPartitionItems(Optional<MvccSnapshot> snapshot,
+            ConnectorMetadata metadata, ConnectorSession session, 
ConnectorTableHandle handle,
+            List<Column> partitionColumns, Optional<ConnectorExpression> 
partitionFilter) {
+        List<String> remoteNames = getSchemaCacheValue(snapshot)
+                .map(value -> ((PluginDrivenSchemaCacheValue) 
value).getPartitionColumnRemoteNames())
+                .orElse(Collections.emptyList());
+        List<Type> types = 
partitionColumns.stream().map(Column::getType).collect(Collectors.toList());
+        List<ConnectorPartitionInfo> partitions = 
metadata.listPartitions(session, handle, partitionFilter);

Review Comment:
   Addressed. Both deferred paths now build items through the same 
source-agnostic `TablePartitionValues` builder used by the eager MVCC LIST path 
(`PluginDrivenExternalTable.toListPartitionItem`), so ordered values and 
connector-supplied NULL flags are preserved and a per-partition conversion 
failure keeps the LIST-path contract (log, skip, disable pruning, preserve 
scan-all) instead of throwing for the whole set.



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