Github user BryanCutler commented on a diff in the pull request:
https://github.com/apache/spark/pull/18659#discussion_r129928163
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowConverters.scala
---
@@ -132,6 +135,61 @@ private[sql] object ArrowConverters {
}
}
+ private[sql] def fromPayloadIterator(iter: Iterator[ArrowPayload]):
Iterator[InternalRow] = {
+ new Iterator[InternalRow] {
+ private val _allocator = new RootAllocator(Long.MaxValue)
+ private var _reader: ArrowFileReader = _
+ private var _root: VectorSchemaRoot = _
+ private var _index = 0
+
+ loadNextBatch()
+
+ override def hasNext: Boolean = _root != null && _index <
_root.getRowCount
+
+ override def next(): InternalRow = {
+ val fields = _root.getFieldVectors.asScala
+
+ val genericRowData = fields.map { field =>
+ field.getAccessor.getObject(_index)
+ }.toArray[Any]
--- End diff --
Thanks @kiszk , I'm giving it a try!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]