weimingdiit commented on code in PR #2424:
URL: https://github.com/apache/auron/pull/2424#discussion_r3655568290
##########
native-engine/datafusion-ext-plans/src/common/row_null_checker.rs:
##########
@@ -52,15 +60,32 @@ impl RowNullChecker {
/// - `false` bits indicate rows that contain at least one null value
/// - `true` bits indicate rows where all fields are non-null
pub fn has_nulls(&self, rows: &Rows) -> NullBuffer {
- // Create NullBuffer from the collected bits
- NullBuffer::from_iter((0..rows.num_rows()).map(|row_index| {
- let row_data = rows.row(row_index);
- // Check if this row has any null values
- let has_null = self.has_null(row_data.as_ref());
- // NullBuffer uses true for valid (non-null) and false for null
- // So we need to invert the result since has_null returns true for
"has nulls"
- !has_null
- }))
+ let parser = self.row_converter.parser();
+ let parsed_rows = rows
+ .iter()
+ .map(|row| parser.parse(row.data()))
+ .collect::<Vec<_>>();
+ let key_columns = self
+ .row_converter
+ .convert_rows(parsed_rows)
+ .expect("failed to decode row data in RowNullChecker");
+
+ NullBuffer::from_iter(
+ (0..rows.num_rows())
+ .map(|row_index| key_columns.iter().all(|column|
!column.is_null(row_index))),
Review Comment:
Good point. I updated the change to preserve the existing byte-level fast
path for simple key types.
RowNullChecker now only decodes rows when the key schema contains complex
types that need Arrow-level logical null handling, such as
struct/list/dictionary. Primitive, boolean, variable-width, fixed-size binary,
and NullType keys continue to use the existing encoded-row sentinel checks, so
the common sort-merge join path should avoid the extra decode cost.
--
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]