Chen-Yuan-Lai commented on code in PR #14341:
URL: https://github.com/apache/datafusion/pull/14341#discussion_r1934067753

##########
datafusion/physical-expr-common/src/binary_map.rs:
##########
@@ -553,10 +553,11 @@ where
 
 /// Returns a `NullBuffer` with a single null value at the given index
 fn single_null_buffer(num_values: usize, null_index: usize) -> NullBuffer {
-    let mut bool_builder = BooleanBufferBuilder::new(num_values);
-    bool_builder.append_n(num_values, true);
-    bool_builder.set_bit(null_index, false);
-    NullBuffer::from(bool_builder.finish())
+    let mut null_builder = NullBufferBuilder::new(num_values);
+    null_builder.append_n_non_nulls(null_index);
+    null_builder.append_null();
+    null_builder.append_n_non_nulls(num_values - null_index - 1);
+    null_builder.finish().unwrap()

Review Comment:
   Thanks @xudong963 and @comphead , I have added the comment



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to