public class GPUdbSqlIterator<T extends Record> extends Object implements Iterable<T>, AutoCloseable
GPUdb
instance and an SQL statement to facilitate iteration
over the records returned by the query. SQL options can be passed as
a Map
. The 'batchSize' for the number of records
returned is set to a default of '10000', which can be modified using
the parameter 'batchSize' to the constructor.
Copyright (c) 2023 Kinetica DB Inc.Constructor and Description |
---|
GPUdbSqlIterator(GPUdb db,
String sql)
Constructor for
GPUdbSqlIterator |
GPUdbSqlIterator(GPUdb db,
String sql,
int batchSize)
Constructor for
GPUdbSqlIterator |
GPUdbSqlIterator(GPUdb db,
String sql,
int batchSize,
Map<String,String> sqlOptions)
Constructor for
GPUdbSqlIterator |
GPUdbSqlIterator(GPUdb db,
String sql,
Map<String,String> sqlOptions)
Constructor for
GPUdbSqlIterator |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Iterator<T> |
iterator() |
void |
setSqlOptions(Map<String,String> sqlOptions) |
long |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public GPUdbSqlIterator(GPUdb db, String sql) throws GPUdbException
GPUdbSqlIterator
db
- - a GPUdb
instancesql
- - the SQL statement to executeGPUdbException
public GPUdbSqlIterator(GPUdb db, String sql, int batchSize) throws GPUdbException
GPUdbSqlIterator
db
- - a GPUdb
instancesql
- - the SQL statement to executebatchSize
- - the number of records to fetchGPUdbException
public GPUdbSqlIterator(GPUdb db, String sql, Map<String,String> sqlOptions) throws GPUdbException
GPUdbSqlIterator
db
- - a GPUdb
instancesql
- - the SQL statement to executesqlOptions
- - the SQL options to be passed inGPUdbException
GPUdb.executeSql(String, long, long, String, List, Map)
public GPUdbSqlIterator(GPUdb db, String sql, int batchSize, Map<String,String> sqlOptions) throws GPUdbException
GPUdbSqlIterator
db
- - a GPUdb
instancesql
- - the SQL statement to executebatchSize
- - the number of records to fetchsqlOptions
- - the SQL options to be passed inGPUdbException
GPUdb.executeSql(String, long, long, String, List, Map)
public long size()
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2025. All rights reserved.