Package org.apache.arrow.adapter.jdbc
Class ArrowVectorIterator
java.lang.Object
org.apache.arrow.adapter.jdbc.ArrowVectorIterator
- All Implemented Interfaces:
AutoCloseable
,Iterator<VectorSchemaRoot>
public class ArrowVectorIterator
extends Object
implements Iterator<VectorSchemaRoot>, AutoCloseable
VectorSchemaRoot iterator for partially converting JDBC data.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Clean up resources ONLY WHEN THEVectorSchemaRoot
HOLDING EACH BATCH IS REUSED.static ArrowVectorIterator
create
(ResultSet resultSet, JdbcToArrowConfig config) Create a ArrowVectorIterator to partially convert data.boolean
hasNext()
next()
Gets the next vector.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Method Details
-
create
public static ArrowVectorIterator create(ResultSet resultSet, JdbcToArrowConfig config) throws SQLException Create a ArrowVectorIterator to partially convert data.- Throws:
SQLException
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<VectorSchemaRoot>
-
next
Gets the next vector. IfJdbcToArrowConfig.isReuseVectorSchemaRoot()
is false, the client is responsible for freeing its resources.- Specified by:
next
in interfaceIterator<VectorSchemaRoot>
- Throws:
JdbcConsumerException
- on error from VectorConsumer
-
close
public void close()Clean up resources ONLY WHEN THEVectorSchemaRoot
HOLDING EACH BATCH IS REUSED. If a new VectorSchemaRoot is created for each batch, each root must be closed manually by the client code.- Specified by:
close
in interfaceAutoCloseable
-