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


##########
be/src/format_v2/parquet/reader/native/column_chunk_reader.cpp:
##########
@@ -1725,22 +1883,104 @@ Status ColumnChunkReader<IN_COLLECTION, 
OFFSET_INDEX>::filter_fixed_width_values
                 selection.total_values);
     }
 
+    VExprSPtrs raw_conjuncts;
+    VExprSPtrs null_map_conjuncts;
+    for (const auto& conjunct : conjuncts) {
+        if (conjunct->can_execute_on_null_map(_field_schema->data_type, 
column_id)) {
+            null_map_conjuncts.push_back(conjunct);
+        } else {
+            raw_conjuncts.push_back(conjunct);
+        }
+    }
     physical_matches->clear();
+    physical_conversion_nulls->clear();
     if (selection.selected_values == 0) {
         RETURN_IF_ERROR(_page_decoder->skip_values(selection.total_values));
+        *execution_kind = DirectPredicateExecutionKind::DEFINITION_LEVEL;
+    } else if (raw_conjuncts.empty()) {
+        if (serde.supports_parquet_raw_predicate(decode_context)) {
+            // Definition levels alone cannot distinguish a present payload 
that permissive SerDe
+            // conversion turns into NULL (or a strict conversion error). 
Decode only the selected
+            // payloads through the same conversion kernel before evaluating 
IS NULL/IS NOT NULL.
+            SelectedDecodeSource selected_source(*_page_decoder, selection);
+            FixedWidthPredicateConsumer consumer(raw_conjuncts, 
_field_schema->data_type, column_id,
+                                                 physical_matches, 
projected_column,
+                                                 physical_conversion_nulls);
+            RETURN_IF_ERROR(serde.read_parquet_raw_predicate(selected_source, 
decode_context,
+                                                             
selection.selected_values,
+                                                             
enable_strict_mode, consumer));
+            // Conversion is needed only to refine the logical null map; no 
value predicate ran.
+            *execution_kind = DirectPredicateExecutionKind::DEFINITION_LEVEL;
+        } else {
+            
RETURN_IF_ERROR(_page_decoder->skip_values(selection.total_values));
+            physical_matches->resize_fill(selection.selected_values, 1);
+            *execution_kind = DirectPredicateExecutionKind::DEFINITION_LEVEL;
+        }
     } else {
-        FixedWidthPredicateConsumer consumer(conjuncts, 
_field_schema->data_type, column_id,
-                                             physical_matches, 
projected_column);
-        RETURN_IF_ERROR(_page_decoder->decode_selected_fixed_values(selection, 
consumer));
+        const bool all_raw_binary = std::ranges::all_of(raw_conjuncts, 
[&](const auto& conjunct) {
+            return 
conjunct->can_execute_on_raw_binary_values(_field_schema->data_type, column_id);
+        });
+        const bool all_raw_fixed = std::ranges::all_of(raw_conjuncts, 
[&](const auto& conjunct) {
+            return 
conjunct->can_execute_on_raw_fixed_values(_field_schema->data_type, column_id);
+        });
+        if (all_raw_binary &&
+            supports_raw_binary_filter_encoding(_current_encoding, 
_metadata.type)) {
+            BinaryPredicateConsumer consumer(raw_conjuncts, 
_field_schema->data_type, column_id,
+                                             physical_matches, 
projected_column,
+                                             &_binary_predicate_refs, 
&_binary_projected_refs);
+            if (_metadata.type == tparquet::Type::BYTE_ARRAY) {
+                
RETURN_IF_ERROR(_page_decoder->decode_selected_binary_values(selection, 
consumer));
+            } else {
+                
RETURN_IF_ERROR(_page_decoder->decode_selected_fixed_values(selection, 
consumer));
+            }
+            *execution_kind = DirectPredicateExecutionKind::RAW_BINARY;
+        } else if (all_raw_fixed && 
serde.supports_parquet_raw_predicate(decode_context)) {

Review Comment:
   [P2] Keep identity primitives on the decoder-direct path
   
   On supported non-dictionary encodings, this branch catches the identity 
mappings (`BOOLEAN`, `INT32 -> INT`, `INT64 -> BIGINT`, `FLOAT`, and `DOUBLE`) 
because `DataTypeNumberSerDe::supports_parquet_raw_predicate()` returns true 
for them. `NumberPredicateParquetConsumer::consume()` then copies every 
selected value into `_parquet_predicate_values` and zero-fills 
`_parquet_predicate_nulls` before the predicate runs. For 
INT/BIGINT/FLOAT/DOUBLE this replaces the pre-existing direct decoder-buffer 
path; for the newly admitted BOOLEAN case it misses that same zero-copy kernel. 
On those non-dictionary pages, the broad check in the `raw_conjuncts.empty()` 
branch also decodes and copies all present identity payloads for `IS NULL`/`IS 
NOT NULL`, even though their definition levels are already exact. Please retain 
the SerDe path only where conversion can change values/nulls/errors, preserve 
decoder-direct evaluation (or payload skipping) for exact mappings, and assert 
those execution kinds i
 n tests.



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