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


##########
fe/be-java-extensions/jni-spi/src/main/java/org/apache/doris/jni/spi/vec/VectorColumn.java:
##########
@@ -1242,7 +1242,14 @@ public int appendTimeStampTz(LocalDateTime v) {
     }
 
     private void putTimeStampTz(int rowId, LocalDateTime v) {
-        // TimeStampTz use the same storage format as DateTimeV2
+        // NULLs use an out-of-range sentinel, but real UTC values must fit 
Doris before bit packing.
+        if (isNullAt(rowId)) {
+            OffHeap.putLong(null, data + rowId * 8L, 0L);
+            return;
+        }
+        if (v.getYear() < 1 || v.getYear() > 9999) {

Review Comment:
   [P2] Allow supported year-zero TIMESTAMPTZ values through JNI. Doris already 
stores and returns `0000-01-01 00:00:00 +00:00` as TIMESTAMPTZ 
(`test_timestamptz_storage_dup_key`), but this new `< 1` check throws for that 
value. For example, PostgreSQL `0001 BC` becomes Java year zero, passes the new 
PostgreSQL handler's lower bound, then aborts the entire JDBC scan here; the 
added test covers only `0002 BC`. Use the supported year-zero lower bound and 
add a scalar/array boundary case.



##########
be/src/format/orc/vorc_reader.h:
##########
@@ -654,6 +654,18 @@ class OrcReader : public TableFormatReader, public 
RowPositionProvider {
                     continue;
                 }
             }
+            if (data->hasNulls && !data->notNull[i]) {
+                continue;
+            }
+            // Check the UTC epoch before packing: ORC permits years outside 
Doris's 0001-9999 range.
+            static constexpr int64_t MIN_SECONDS = -62135596800LL;

Review Comment:
   [P2] Preserve year-zero TIMESTAMPTZ reads in ORC V1. Doris already accepts 
and stores `0000-01-01 00:00:00 +00:00` as TIMESTAMPTZ (see 
`test_timestamptz_storage_dup_key`), but this new year-one lower bound makes a 
Hive ORC `TIMESTAMP_INSTANT` at that same UTC instant fail with 
DataQualityError when the V1 scanner is selected. The V2 reader and prior V1 
path accept the value. Keep the upper-bound validation while allowing year-zero 
UTC instants, and cover the V1/V2 boundary in a scan test.



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