You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/16 07:48:48 UTC

[GitHub] [arrow-rs] alamb commented on a change in pull request #1435: Improve performance of DictionaryArray::try_new()

alamb commented on a change in pull request #1435:
URL: https://github.com/apache/arrow-rs/pull/1435#discussion_r827709336



##########
File path: arrow/src/array/data.rs
##########
@@ -936,68 +936,68 @@ impl ArrayData {
             )));
         }
 
+        self.validate_dictionary_offest()?;
+
+        // validate all children recursively
+        self.child_data
+            .iter()
+            .enumerate()
+            .try_for_each(|(i, child_data)| {
+                child_data.validate_full().map_err(|e| {
+                    ArrowError::InvalidArgumentError(format!(
+                        "{} child #{} invalid: {}",
+                        self.data_type, i, e
+                    ))
+                })
+            })?;
+
+        Ok(())
+    }
+
+    pub fn validate_dictionary_offest(&self) -> Result<()> {

Review comment:
       there is a typo here I think:
   
   ```suggestion
       pub fn validate_dictionary_offset(&self) -> Result<()> {
   ```

##########
File path: arrow/src/array/data.rs
##########
@@ -936,68 +936,68 @@ impl ArrayData {
             )));
         }
 
+        self.validate_dictionary_offest()?;
+
+        // validate all children recursively
+        self.child_data
+            .iter()
+            .enumerate()
+            .try_for_each(|(i, child_data)| {
+                child_data.validate_full().map_err(|e| {
+                    ArrowError::InvalidArgumentError(format!(
+                        "{} child #{} invalid: {}",
+                        self.data_type, i, e
+                    ))
+                })
+            })?;
+
+        Ok(())
+    }
+
+    pub fn validate_dictionary_offest(&self) -> Result<()> {

Review comment:
       It might be clearer to call this `validate_dictionary_offsets_full`




-- 
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-unsubscribe@arrow.apache.org

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