klion26 commented on code in PR #9685:
URL: https://github.com/apache/arrow-rs/pull/9685#discussion_r3063248406


##########
parquet-variant-compute/src/from_json.rs:
##########
@@ -26,12 +26,21 @@ use parquet_variant_json::JsonToVariant;
 /// Macro to convert string array to variant array
 macro_rules! string_array_to_variant {
     ($input:expr, $array:expr, $builder:expr) => {{
-        for i in 0..$input.len() {
-            if $input.is_null(i) {
-                $builder.append_null();
-            } else {
+        let len = $input.len();
+        let mut i = 0;
+        while i < len {
+            if !$input.is_null(i) {

Review Comment:
   We can use `input.is_valid(i)` here



##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -156,6 +156,26 @@ impl VariantArrayBuilder {
         self.value_offsets.push(self.value_builder.offset());
     }
 
+    /// Appends `count` null rows to the builder.
+    pub fn append_nulls(&mut self, count: usize) {
+        if count == 0 {
+            return;
+        }
+        if count == 1 {

Review Comment:
   Is there any downside to merge this into `append_n_nulls`



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