vibhatha commented on code in PR #41967:
URL: https://github.com/apache/arrow/pull/41967#discussion_r1634876338


##########
java/c/src/test/python/integration_tests.py:
##########
@@ -183,6 +190,55 @@ def round_trip_reader(self, schema, batches):
     def test_string_array(self):
         self.round_trip_array(lambda: pa.array([None, "a", "bb", "ccc"]))
 
+    def test_stringview_array(self):
+        # with nulls short strings
+        self.round_trip_array(lambda: pa.array([None, "a", "bb", "c"], 
type=pa.string_view()))
+        # with nulls long and strings
+        self.round_trip_array(lambda: pa.array([None, "a", "bb"*10, "c"*13], 
type=pa.string_view()))
+        # without nulls short strings
+        self.round_trip_array(lambda: pa.array(["a", "bb", "c"], 
type=pa.string_view()))
+        # without nulls long and strings
+        self.round_trip_array(lambda: pa.array(["a", "bb"*10, "c"*13], 
type=pa.string_view()))
+        # with multiple data buffers
+        data = []
+        for i in range(1, 501):
+            s = ''.join(str(j) for j in range(i))
+            data.append(s)
+        self.round_trip_array(lambda: pa.array(data, type=pa.string_view()))

Review Comment:
   Ah that's more neater. 



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