Package com.databricks.jdbc.api.impl.arrow

## Class ArrowStreamResult

- java.lang.Object
- - com.databricks.jdbc.api.impl.arrow.ArrowStreamResult

All Implemented Interfaces:
  `IExecutionResult`

    public class ArrowStreamResult
    extends Object
    implements IExecutionResult

Result container for Arrow-based query results.

### Constructor Summary

Constructors
`ArrowStreamResult​(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatementId, IDatabricksSession session)`
`ArrowStreamResult​(ResultManifest resultManifest, ResultData resultData, StatementId statementId, IDatabricksSession session)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `close()` Closes the result set and releases any in-memory chunks or data
`List<String>` `getArrowMetadata()`
`long` `getChunkCount()`
`ChunkProvider` `getChunkProvider()` Returns the chunk provider for testing purposes.
`long` `getCurrentRow()` Gets the current row position, starting with 0.
`Object` `getObject​(int columnIndex)` Get the object for given column index.
`protected static Object` `getObjectWithComplexTypeHandling​(IDatabricksSession session, ArrowResultChunkIterator chunkIterator, int columnIndex, ColumnInfoTypeName requiredType, String arrowMetadata, ColumnInfo columnInfo)` Helper method to handle complex type and geospatial type conversion when support is disabled.
`long` `getRowCount()`
`boolean` `hasNext()` Returns if there is next row in the result set
`static boolean` `isComplexType​(ColumnInfoTypeName type)` Checks if the given type is a complex type (ARRAY, MAP, STRUCT, GEOMETRY, or GEOGRAPHY).
`static boolean` `isGeospatialType​(ColumnInfoTypeName type)` Checks if the given type is a geospatial type (GEOMETRY or GEOGRAPHY).
`boolean` `next()` Moves the cursor to next row and returns true if this can be done

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ArrowStreamResult

    public ArrowStreamResult​(ResultManifest resultManifest,
                             ResultData resultData,
                             StatementId statementId,
                             IDatabricksSession session)
                      throws DatabricksSQLException

Throws:
  `DatabricksSQLException`

#### ArrowStreamResult

    public ArrowStreamResult​(TFetchResultsResp resultsResp,
                             IDatabricksStatementInternal parentStatementId,
                             IDatabricksSession session)
                      throws SQLException

Throws:
  `SQLException`

### Method Detail

#### getArrowMetadata

    public List<String> getArrowMetadata()
                                  throws DatabricksSQLException

Throws:
  `DatabricksSQLException`

#### getObject

    public Object getObject​(int columnIndex)
                     throws DatabricksSQLException

Get the object for given column index. Here index starts with 0.

Specified by:
  `getObject` in interface `IExecutionResult`
Parameters:
  `columnIndex` - index of column starting with 0
Returns:
  object at given index
Throws:
  `DatabricksSQLException` - if there is any error in getting object

#### isComplexType

    public static boolean isComplexType​(ColumnInfoTypeName type)

Checks if the given type is a complex type (ARRAY, MAP, STRUCT, GEOMETRY, or GEOGRAPHY).

Parameters:
  `type` - The type to check
Returns:
  true if the type is a complex type, false otherwise

#### isGeospatialType

    public static boolean isGeospatialType​(ColumnInfoTypeName type)

Checks if the given type is a geospatial type (GEOMETRY or GEOGRAPHY).

Parameters:
  `type` - The type to check
Returns:
  true if the type is a geospatial type, false otherwise

#### getCurrentRow

    public long getCurrentRow()

Gets the current row position, starting with 0.

Specified by:
  `getCurrentRow` in interface `IExecutionResult`
Returns:
  the current row position

#### next

    public boolean next()
                 throws DatabricksSQLException

Moves the cursor to next row and returns true if this can be done

Specified by:
  `next` in interface `IExecutionResult`
Returns:
  true if cursor is moved at next row
Throws:
  `DatabricksSQLException`

#### hasNext

    public boolean hasNext()

Returns if there is next row in the result set

Specified by:
  `hasNext` in interface `IExecutionResult`

#### close

    public void close()

Closes the result set and releases any in-memory chunks or data

Specified by:
  `close` in interface `IExecutionResult`

#### getRowCount

    public long getRowCount()

Specified by:
  `getRowCount` in interface `IExecutionResult`

#### getChunkCount

    public long getChunkCount()

Specified by:
  `getChunkCount` in interface `IExecutionResult`

#### getChunkProvider

    public ChunkProvider getChunkProvider()

Returns the chunk provider for testing purposes.

Returns:
  the chunk provider

#### getObjectWithComplexTypeHandling

    protected static Object getObjectWithComplexTypeHandling​(IDatabricksSession session,
                                                             ArrowResultChunkIterator chunkIterator,
                                                             int columnIndex,
                                                             ColumnInfoTypeName requiredType,
                                                             String arrowMetadata,
                                                             ColumnInfo columnInfo)
                                                      throws DatabricksSQLException

Helper method to handle complex type and geospatial type conversion when support is disabled.

This method is also used by LazyThriftInlineArrowResult for consistent type handling.

Parameters:
  `session` - The databricks session
  `chunkIterator` - The chunk iterator
  `columnIndex` - The column index
  `requiredType` - The required column type
  `arrowMetadata` - The arrow metadata
  `columnInfo` - The column info
Returns:
  The object value (converted if complex/geospatial type and support disabled)
Throws:
  `DatabricksSQLException` - if an error occurs