tustvold commented on code in PR #3593:
URL: https://github.com/apache/arrow-rs/pull/3593#discussion_r1085141674


##########
arrow-array/src/array/string_array.rs:
##########
@@ -45,50 +45,6 @@ impl<OffsetSize: OffsetSizeTrait> 
GenericStringArray<OffsetSize> {
         self.value(i).chars().count()
     }
 
-    /// Convert a list array to a string array.
-    ///
-    /// Note: this performs potentially expensive UTF-8 validation, consider 
using
-    /// [`StringBuilder`][crate::builder::StringBuilder] to avoid this
-    ///
-    /// # Panics
-    ///
-    /// This method panics if the array contains non-UTF-8 data
-    fn from_list(v: GenericListArray<OffsetSize>) -> Self {
-        assert_eq!(
-            v.data_ref().child_data().len(),
-            1,
-            "StringArray can only be created from list array of u8 values \
-             (i.e. List<PrimitiveArray<u8>>)."
-        );
-        let child_data = &v.data_ref().child_data()[0];
-
-        assert_eq!(
-            child_data.child_data().len(),
-            0,
-            "StringArray can only be created from list array of u8 values \
-             (i.e. List<PrimitiveArray<u8>>)."
-        );
-        assert_eq!(
-            child_data.data_type(),
-            &DataType::UInt8,
-            "StringArray can only be created from List<u8> arrays, mismatched 
data types."
-        );
-        assert_eq!(
-            child_data.null_count(),
-            0,
-            "The child array cannot contain null values."
-        );
-
-        let builder = ArrayData::builder(Self::DATA_TYPE)
-            .len(v.len())
-            .offset(v.offset())
-            .add_buffer(v.data().buffers()[0].clone())
-            .add_buffer(child_data.buffers()[0].slice(child_data.offset()))
-            .null_bit_buffer(v.data().null_buffer().cloned());
-
-        Self::from(builder.build().unwrap())

Review Comment:
   This is what previously performed UTF-8 validation



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