github-actions[bot] commented on code in PR #68161:
URL: https://github.com/apache/doris/pull/68161#discussion_r4313212832


##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -219,17 +244,28 @@ private void initReader() throws IOException {
             }
             outputToReadIndex[outputIndex] = readIndex;
             DataField tableField = 
table.rowType().getFields().get(projected[readIndex]);
+            if (requiresDatetimeV2PrecisionRepair && dataSource instanceof 
FallbackReadFileStoreTable
+                    && !SpecialFields.isSystemField(tableField.name())) {
+                // Fallback schemas agree positionally, but their names and 
field IDs are independent.
+                // Resolve positions in the data schema, not a system 
wrapper's rowkind-prefixed schema.
+                int dataIndex = 
dataSource.rowType().getFieldIndex(tableField.name());
+                Preconditions.checkState(dataIndex >= 0, "Data field %s not 
found in schema", tableField.name());
+                tableField = policyTableType.getFields().get(dataIndex);

Review Comment:
   [P1] Preserve the binlog array wrapper when rebinding branch fields
   
   For a partitioned fallback table whose current branches have `ts 
TIMESTAMP(0)` and whose secondary retains a p6 file, `SELECT ts FROM t$binlog` 
enables precision repair and goes through JNI. Paimon's [BinlogTable exposes 
each data field as an 
ARRAY](https://github.com/apache/paimon/blob/release-1.4.2/paimon-core/src/main/java/org/apache/paimon/table/system/BinlogTable.java#L69-L76),
 so the requested output is `ARRAY<DATETIMEV2(0)>`. This replacement 
substitutes the selected branch's scalar `TIMESTAMP(0)` field; 
`PaimonReadTypeProjection.project` then throws `Doris requested ARRAY ... but 
the source type is SCALAR`, and the scan cannot open. The previous projection 
retained the wrapper, so even whole-second values now fail. Rebind field 
identity while rebuilding the system-table type wrapper, and cover historical 
fallback `$binlog` reads under both branch orderings. This differs from the 
existing ordinary fallback-ID finding because the outer and data schemas have 
different shapes.



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