Class DruidJdbcResultSet

java.lang.Object
org.apache.druid.sql.avatica.DruidJdbcResultSet
All Implemented Interfaces:
Closeable, AutoCloseable

public class DruidJdbcResultSet extends Object implements Closeable
Druid's server-side representation of a JDBC result set. At most one can be open per statement (standard or prepared). The implementation is based on Druid's own DirectStatement class. Even if result set is for a PreparedStatement, the result set itself uses a Druid DirectStatement which includes the parameter values given for the execution. This allows Druid's planner to use the "query optimized" form of parameter substitution: we replan the query for each execution with the parameter values.

Avatica returns results in Meta.Frame objects as batches of rows. The result set uses the TYPE_FORWARD_ONLY execution model: the application can only read results sequentially, the application can't jump around or read backwards. As a result, the enclosing statement closes the result set at EOF to release resources early.

Thread safe, but only when accessed sequentially by different request threads: not designed for concurrent access as JDBC does not support concurrent actions on the same result set.

  • Constructor Details

  • Method Details

    • execute

      public void execute()
    • isDone

      public boolean isDone()
    • getSignature

      public org.apache.calcite.avatica.Meta.Signature getSignature()
    • nextFrame

      public org.apache.calcite.avatica.Meta.Frame nextFrame(long fetchOffset, int fetchMaxRowCount)
    • getCurrentOffset

      public long getCurrentOffset()
    • close

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