weimingdiit commented on code in PR #2424:
URL: https://github.com/apache/auron/pull/2424#discussion_r3655569288
##########
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:
Thanks for calling this out. I switched the decoded path from Array::is_null
to Array::logical_nulls().
That preserves the old NullType behavior: when a NullType key reaches the
decoded path, Arrow's NullArray logical null buffer marks all rows as null. I
also added coverage for a NullType key combined with a complex key to force the
decoded path and verify those rows are treated as null.
--
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]