Interface RowCursor

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
RowCursorCsv, RowCursorResultSet

public interface RowCursor extends AutoCloseable
Supplies tabular rows from a live underlying source.

A row supplier represents an open row cursor. Some implementations own the underlying resource and release it on close(), while others adapt caller-owned resources and treat close() as a no-op.

The ColumnDefinitions returned by columns() describe the source-side schema seen by the row consumer. In particular, any source-specified column types can influence which low-level builders are created before rows are read. That matters when the caller wants to avoid an intermediate in-memory String column and parse slices directly into the final builder, for example:

- primitive numeric columns such as int, long, and double

- fast enum-like object types with a direct CharSequence parser, when that is materially better than first building a string dictionary

- high-cardinality columns where building a full string column and then parsing it later would be unnecessary work

For ordinary categorical text, source-side typing is usually not necessary. In that common case it is often better to let the row consumer build the natural string dictionary first and only request a direct source type when that parser has a real advantage over storing dictionary strings.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Returns the source-side column definitions exposed by this cursor.
     
    boolean
     
  • Method Details

    • columns

      ColumnDefinition[] columns()
      Returns the source-side column definitions exposed by this cursor.

      A non-null type here is not just metadata. It can be used by downstream row consumers to choose a more direct builder from the start, bypassing intermediate String materialization when the source type already has an efficient slice-based parser.

      That is most useful for primitive numerics and for special object types whose direct parser is genuinely better than first building a string dictionary.

      Returns:
      the source column definitions in source order
    • next

      boolean next()
    • current

      Row current()
    • close

      void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception