924060929 commented on code in PR #66530:
URL: https://github.com/apache/doris/pull/66530#discussion_r3850248298


##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveScanPlanProvider.java:
##########
@@ -131,6 +134,33 @@ public boolean usesHiveParquetInt96TimeZone() {
 
     @Override
     public List<ConnectorScanRange> planScan(ConnectorSession session, 
ConnectorScanRequest request) {
+        HiveTableHandle hiveHandle = (HiveTableHandle) 
request.getTableHandle();
+        if (!isExternalScanTaskReuseEnabled(session)) {
+            return doPlanScan(session, request);
+        }
+        if (hiveHandle.isTransactional()) {
+            // ACID / INSERT_ONLY reads open a per-scan read transaction with 
a write-id snapshot and
+            // a shared metastore lock; reusing the planned ranges would skip 
that transaction.
+            return doPlanScan(session, request);
+        }
+        // Statement-scoped reuse: within one statement the identical scan 
(same table, same
+        // partition set, same formats) plans once and every duplicated 
relation shares the result.
+        // The scope is NONE for offline planning and tests, in which case the 
loader runs on every
+        // call. Session variables are constant within a statement and 
deliberately absent.
+        String memoKey = "hive.scan-reuse:" + session.getCatalogId() + ":" + 
session.getQueryId();

Review Comment:
   Fixed in 97c8f77b66b29ba85ab91261d25ebfcf942a7919. Hive now uses the 
provider-owned `hms.scan-reuse` namespace, and Hive/Hudi/Iceberg/Paimon all 
declare `SCAN_REUSE_NAMESPACE` constants with provider-type prefix guards. 
Focused tests passed (275 tests total), `git diff --check` passed, and 
`./build.sh --fe` completed all 73 modules with 0 Checkstyle violations.



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