Class IterableRowStream<T>

java.lang.Object
org.apache.nifi.sql.IterableRowStream<T>
Type Parameters:
T - the type object in the Iterable
All Implemented Interfaces:
AutoCloseable, RowStream

public class IterableRowStream<T> extends Object implements RowStream
A convenience implementation of RowStream that can be used to convert any Iterable to a RowStream.
  • Field Details

  • Constructor Details

    • IterableRowStream

      public IterableRowStream(Iterable<T> iterable, Function<T,Object[]> transform)
      Creates an IterableRowStream that is capable of iterating over the objects in the given Iterable
      Parameters:
      iterable - an Iterable that is capable of iterating over objects
      transform - a transformation function that is capable of converting the Objects in the Iterable to the Object[] necessary for Calcite.
  • Method Details

    • nextRow

      public Object[] nextRow()
      Description copied from interface: RowStream
      Returns the next row of data as an object array, or null if the stream is out of data. Note that the objects returned MUST adhere to the schema of the ResettableDataSource that created this RowStream.
      Specified by:
      nextRow in interface RowStream
      Returns:
      the next row of data, or null if there is no more data
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable