bkietz commented on code in PR #39019:
URL: https://github.com/apache/arrow/pull/39019#discussion_r1428033919


##########
dev/archery/archery/integration/datagen.py:
##########
@@ -927,6 +927,85 @@ class LargeListColumn(_BaseListColumn, _LargeOffsetsMixin):
     pass
 
 
+class ListViewField(Field):
+
+    def __init__(self, name, value_field, *, nullable=True,
+                 metadata=None):
+        super().__init__(name, nullable=nullable,
+                         metadata=metadata)
+        self.value_field = value_field
+
+    @property
+    def column_class(self):
+        return ListViewColumn
+
+    def _get_type(self):
+        return OrderedDict([
+            ('name', 'listview')
+        ])
+
+    def _get_children(self):
+        return [self.value_field.get_json()]
+
+    def generate_column(self, size, name=None):
+        MAX_LIST_SIZE = 4
+
+        is_valid = self._make_is_valid(size)
+        offsets = []
+        sizes = np.random.randint(0, MAX_LIST_SIZE + 1, size=size)
+        offset = 0
+        for s in sizes:
+            offsets.append(offset)
+            offset += int(s)

Review Comment:
   
https://github.com/apache/arrow/pull/39019/commits/03a12f9cf50dbb92184afd815a73454b138ce713



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

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

Reply via email to