Package ai.velr

Class Table

java.lang.Object
ai.velr.Table
All Implemented Interfaces:
AutoCloseable

public final class Table extends Object implements AutoCloseable
One result table returned by a query.

A table owns row cursors opened from it. Close the table when it is no longer needed. Tables returned from Velr.execOne(String) are parented to the connection; tables pulled from a Stream are stream-scoped and are closed when their stream is closed.

  • Method Details

    • columnCount

      public int columnCount()
      Return the number of columns in this result table.
      Returns:
      column count
    • columnNames

      public List<String> columnNames()
      Return result column names in order.
      Returns:
      immutable column-name list
    • rows

      public Rows rows()
      Open a streaming row cursor for this table.
      Returns:
      row cursor; close it when finished
    • collect

      public List<List<Cell>> collect()
      Collect all rows into JVM-owned memory.
      Returns:
      table rows as lists of cells
    • toMaps

      public List<Map<String,Object>> toMaps()
      Collect all rows as maps keyed by column name.
      Returns:
      rows as maps from column name to Java value
    • toArrowIpc

      public byte[] toArrowIpc()
      Export this result table as Arrow IPC file bytes.
      Returns:
      Arrow IPC file / Feather v2 bytes
    • close

      public void close()
      Close this table and any open row cursors owned by it.
      Specified by:
      close in interface AutoCloseable
    • registerChild

      public void registerChild(ai.velr.ChildHandle child)
      Driver-internal child-handle registration method.
    • unregisterChild

      public void unregisterChild(ai.velr.ChildHandle child)
      Driver-internal child-handle unregistration method.