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


##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonColumnValue.java:
##########
@@ -167,7 +168,8 @@ public LocalDate getDate() {
 
     @Override
     public LocalDateTime getDateTime() {
-        Timestamp ts = record.getTimestamp(idx, dorisType.getPrecision());
+        Timestamp ts = truncateTimestampPrecision(

Review Comment:
   Fixed in c637de5659b. The JNI repair path now supplies a recursively widened 
precision-9 read schema before Paimon creates its CastedRow, so historical 
fractional and negative-epoch values are not first narrowed by the SDK. 
PaimonColumnValue reads using the actual Paimon timestamp precision and applies 
fixed-width nanosecond truncation only after materialization; the pre-epoch 
unit boundary is covered and the Parquet/ORC forced-JNI precision-evolution 
suite passes.



##########
fe/be-java-extensions/paimon-scanner/src/main/java/org/apache/doris/paimon/PaimonJniScanner.java:
##########
@@ -332,7 +332,9 @@ private void resetDatetimeV2Precision() {
                 if (index != -1) {
                     DataType dataType = table.rowType().getTypeAt(index);
                     if (dataType instanceof TimestampType) {
-                        types[i].setPrecision(((TimestampType) 
dataType).getPrecision());
+                        int paimonPrecision = ((TimestampType) 
dataType).getPrecision();
+                        requiresDatetimeV2PrecisionRepair |= 
types[i].getPrecision() > paimonPrecision;

Review Comment:
   Fixed in c637de5659b. JNI now enters the repair path conservatively for 
every projected TIMESTAMP/TIMESTAMP_LTZ field before initReader, instead of 
inferring narrowing from two already-evolved FE types. The read schema is 
recursively widened to precision 9 through ROW/ARRAY/MAP, and affected 
predicates are withheld from Paimon executeFilter so the Doris residual runs 
after materialization. The getter then truncates the materialized value to the 
Doris precision. Added leading-zero and recursive-schema unit coverage; the 
forced-JNI Parquet/ORC equality regression passes in the personal external 
suite.



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