slfan1989 commented on code in PR #2424:
URL: https://github.com/apache/auron/pull/2424#discussion_r3651766485


##########
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 fixing null detection for complex row types. However, has_nulls 
is called for every sort-merge join batch, and this change now fully decodes 
all key columns even for primitive keys. Could we preserve the existing fast 
path for simple types and only decode complex types to avoid a regression in 
the common join path?



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

Reply via email to