Skip to main content
Package com.gpudb

Class GPUdbSqlIterator<T extends Record>

java.lang.Object
com.gpudb.GPUdbSqlIterator<T>
All Implemented Interfaces:

public class GPUdbSqlIterator<T extends Record> extends Object implements Iterable<T>, AutoCloseable
Kinetica API class for iterating over records returned by executing an SQL query. This class accepts a 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. Example usage, passing a database connection and a SQL statement to the GPUdbSqlIterator:
 
     try (GPUdbSqlIterator<Record> iterator = new GPUdbSqlIterator<>(gpudb, sql);)
     
         for (Record record : iterator)
             System.out.println(record);
     
     catch (Exception e)
     
         System.err.println(“Error in iteration: ” + e.getMessage());
     
 
Copyright (c) 2023 Kinetica DB Inc.