zhuxiangyi commented on code in PR #8334:
URL: https://github.com/apache/paimon/pull/8334#discussion_r3473048315


##########
paimon-core/src/main/java/org/apache/paimon/operation/BaseAppendFileStoreWrite.java:
##########
@@ -163,9 +163,10 @@ public void withWriteType(RowType writeType) {
         if (blobContext != null) {
             blobContext = blobContext.withWriteType(writeType);
         }
-        int fullCount = rowType.getFieldCount();
         List<String> fullNames = rowType.getFieldNames();
-        this.writeCols = writeType.getFieldNames();
+        // writeCols carries (possibly nested) dotted paths, e.g. ["f0", 
"nest.a"]; a plain
+        // top-level name means the whole column, a dotted path means only 
that sub-field is written
+        this.writeCols = writeType.leafPaths(rowType);

Review Comment:
   Fixed in 7211c708a. `RowType.leafPaths` now fails fast 
(`UnsupportedOperationException`) when a partial struct is nested inside 
another partial struct (a path deeper than one level, e.g. `nest.sub.x`), so 
`withWriteType` rejects it before any such file can be written/committed — a 
low-level `BatchTableWrite.withWriteType(projectByPaths(["nest.sub.x"]))` now 
throws up front instead of committing a file that later breaks full-table 
reads. One-level partial writes (`nest.a`, or a whole sub-struct `nest.sub` 
under a partial `nest`) are unaffected. Added `DataTypesTest#testLeafPaths` 
coverage.



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

Reply via email to