Class CursorFactoryRowsAndColumns

java.lang.Object
org.apache.druid.query.rowsandcols.CursorFactoryRowsAndColumns
All Implemented Interfaces:
Closeable, AutoCloseable, RowsAndColumns, CloseableShapeshifter

public class CursorFactoryRowsAndColumns extends Object implements CloseableShapeshifter, RowsAndColumns
Provides RowsAndColumns on top of a CursorFactory.
  • Constructor Details

    • CursorFactoryRowsAndColumns

      public CursorFactoryRowsAndColumns(CursorFactory cursorFactory)
  • Method Details

    • as

      public <T> T as(Class<T> clazz)
      Description copied from interface: CloseableShapeshifter
      Asks the Object to return itself as a concrete implementation of a specific interface. The interface asked for will tend to be a semantically-meaningful interface.
      Specified by:
      as in interface CloseableShapeshifter
      Specified by:
      as in interface RowsAndColumns
      Type Parameters:
      T - The interface that the calling code wants a concrete implementation of
      Parameters:
      clazz - A class object representing the interface that the calling code wants a concrete implementation of
      Returns:
      A concrete implementation of the interface, or null if there is no meaningful optimization to be had through a local implementation of the interface.
    • getColumnNames

      public Collection<String> getColumnNames()
      Description copied from interface: RowsAndColumns
      The set of column names available from the RowsAndColumns
      Specified by:
      getColumnNames in interface RowsAndColumns
      Returns:
      The set of column names available from the RowsAndColumns
    • numRows

      public int numRows()
      Description copied from interface: RowsAndColumns
      The number of rows in the RowsAndColumns object
      Specified by:
      numRows in interface RowsAndColumns
      Returns:
      the integer number of rows
    • findColumn

      public Column findColumn(String name)
      Description copied from interface: RowsAndColumns
      Finds a column by name. null is returned if the column is not found. The RowsAndColumns object should not attempt to default not-found columns to pretend as if they exist, instead the user of the RowsAndColumns object should decide the correct semantic interpretation of a column that does not exist. It is expected that most locations will choose to believe that the column does exist and is always null, but there are often optimizations that can effect this same assumption without doing a lot of extra work if the calling code knows that it does not exist.
      Specified by:
      findColumn in interface RowsAndColumns
      Parameters:
      name - the name of the column to find
      Returns:
      the Column, if found. null if not found.
    • close

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