OIiveirra commented on code in PR #68161:
URL: https://github.com/apache/doris/pull/68161#discussion_r4311049394


##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -225,11 +245,14 @@ private void initReader() throws IOException {
                     : null;
             variantProjections.add(variantProjection);
             if (variantProjection == null) {
-                // The engine may have pruned this complex column down to the 
sub-fields the query touches.
-                // Mirroring that shape with paimon's own types lets 
withReadType push the same projection
-                // through the ROW/ARRAY/MAP readers instead of reading the 
whole column and discarding it.
                 DataType projectedType =
                         PaimonReadTypeProjection.project(tableField.type(), 
types[outputIndex]);
+                // ColumnType retains the logical precision, independently of 
the widened physical read type.
+                resetTimestampPrecision(types[outputIndex], projectedType);
+                currentFields.add(tableField.newType(projectedType));

Review Comment:
   Fixed in 9f6d3a566bc79788dd274fc6416efd917e17e85d. JNI timestamp-repair 
reads now bind projected data fields to the split-selected branch by positional 
correspondence before constructing the widened read schema, preserving 
branch-local field IDs and logical types. SQL output order is unchanged; system 
fields remain synthesized by the outer wrapper, and hidden policy fields use 
the same selected-branch schema. The change is limited to row-backed fallback 
repair reads; metadata system tables and explicit repair-disabled reads retain 
their existing paths.
   
   Added real historical ORC reader coverage for independently allocated IDs 
under both branch orderings, whole-second non-NULL values, p9-to-p0 truncation 
at .999999500, original NULLs, and reordered projections. The original reader 
test failed before the fix because both secondary non-NULL timestamps became 
NULL. Additional controls cover independently renamed fields and hidden integer 
policy fields (including a rejected row), audit-log rowkind, missing repair 
options, metadata snapshots, and repair-disabled ordinary reads.
   
   Validation passed: all 221 tests across six focused FE/JNI classes, 
Checkstyle and quick checks, the standard ASAN FE/BE build and verified 
personal deployment, and the branch-aligned paimon_timestamp_types External 
suite (1 suite, 0 failures/fatal/skipped). These are local targeted results, 
not a claim that the new community CI run is already green.



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