Copilot commented on code in PR #62177:
URL: https://github.com/apache/doris/pull/62177#discussion_r3045156696


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/FileQueryScanNode.java:
##########
@@ -526,8 +526,10 @@ private TFileRangeDesc createFileRangeDesc(FileSplit 
fileSplit, List<String> col
         // fileSize only be used when format is orc or parquet and TFileType 
is broker
         // When TFileType is other type, it is not necessary
         rangeDesc.setFileSize(fileSplit.getFileLength());
-        rangeDesc.setColumnsFromPath(columnsFromPath);
-        rangeDesc.setColumnsFromPathKeys(columnsFromPathKeys);
+        if (!columnsFromPathKeys.isEmpty()) {
+            rangeDesc.setColumnsFromPath(columnsFromPath);
+            rangeDesc.setColumnsFromPathKeys(columnsFromPathKeys);

Review Comment:
   This change relies on Thrift `__isset` semantics to prevent BE 
partition-column generation when there are no path partition keys, but there’s 
no unit test guarding this contract. Consider adding a `FileQueryScanNodeTest` 
case that builds a `TFileRangeDesc` with empty `columnsFromPathKeys` and 
asserts `columnsFromPath/columnsFromPathKeys` remain unset (and a non-empty 
case remains set), to prevent regressions that could reintroduce the BE OOB 
crash.
   ```suggestion
               rangeDesc.setColumnsFromPathKeys(columnsFromPathKeys);
           } else {
               // Keep these optional thrift fields explicitly unset when there 
are no
               // path partition keys. BE logic distinguishes "unset" from "set 
to empty"
               // and relies on __isset semantics to avoid generating partition 
columns.
               rangeDesc.unsetColumnsFromPath();
               rangeDesc.unsetColumnsFromPathKeys();
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/source/PaimonScanNode.java:
##########
@@ -443,7 +443,9 @@ public List<Split> getSplits(int numBackends) throws 
UserException {
                 if (ignoreSplitType == 
SessionVariable.IgnoreSplitType.IGNORE_JNI) {
                     continue;
                 }
-                splits.add(new PaimonSplit(dataSplit));
+                PaimonSplit jniSplit = new PaimonSplit(dataSplit);
+                jniSplit.setPaimonPartitionValues(partitionInfoMap);
+                splits.add(jniSplit);

Review Comment:
   The new behavior of propagating `partitionInfoMap` into JNI `PaimonSplit` 
instances isn’t covered by unit tests. Consider adding/adjusting 
`PaimonScanNodeTest` to enable runtime filter partition pruning and assert that 
JNI splits get non-null `paimonPartitionValues` (and/or that scan ranges 
include `columnsFromPathKeys/columnsFromPath` for JNI splits).



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