Gabriel39 commented on code in PR #65446:
URL: https://github.com/apache/doris/pull/65446#discussion_r3568130345


##########
be/src/format_v2/orc/orc_reader.cpp:
##########
@@ -2021,6 +2029,19 @@ Status OrcReader::get_aggregate_result(const 
format::FileAggregateRequest& reque
         RETURN_IF_ERROR(find_projected_minmax_leaf(*_state->root_type, 
request_column.projection,
                                                    &leaf_type));
         DORIS_CHECK(leaf_type != nullptr);
+        const bool is_datetime_timestamp =
+                leaf_type->getKind() == ::orc::TypeKind::TIMESTAMP ||
+                (leaf_type->getKind() == ::orc::TypeKind::TIMESTAMP_INSTANT &&
+                 !_enable_mapping_timestamp_tz);
+        if (is_datetime_timestamp) {

Review Comment:
   Verified in 3c5269f4f67. The aggregate path already canonicalizes a negative 
millisecond remainder before converting it to DATETIMEV2, unlike the ORC SARG 
reconstruction that motivated the conservative predicate fallback. The new 
NewOrcReaderTest.AggregatePushdownTimestampMinMaxMatchesNegativeRowDecoding 
uses the pre-epoch fixture and verifies count, min, and max as 1969-12-31 
23:59:58.999999, matching row decoding. The targeted remote ASAN BE unit test 
passed, so a blanket negative-statistics fallback would disable valid aggregate 
pushdown without fixing an incorrect result.



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