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 TypeMethodDescriptionvoidclose()Clean up resources ONLY WHEN THEVectorSchemaRootHOLDING EACH BATCH IS REUSED.static ArrowVectorIteratorcreate(ResultSet resultSet, JdbcToArrowConfig config) Create a ArrowVectorIterator to partially convert data.booleanhasNext()next()Gets the next vector.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
hasNextin interfaceIterator<VectorSchemaRoot>
-
next
Gets the next vector. IfJdbcToArrowConfig.isReuseVectorSchemaRoot()is false, the client is responsible for freeing its resources.- Specified by:
nextin interfaceIterator<VectorSchemaRoot>- Throws:
JdbcConsumerException- on error from VectorConsumer
-
close
public void close()Clean up resources ONLY WHEN THEVectorSchemaRootHOLDING 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:
closein interfaceAutoCloseable
-