net.snowflake.client.jdbc

## Class ArrowResultChunk

- java.lang.Object
- - net.snowflake.client.jdbc.SnowflakeResultChunk
  - - net.snowflake.client.jdbc.ArrowResultChunk

    public class ArrowResultChunk
    extends SnowflakeResultChunk

### Nested Class Summary

Nested Classes
`static class` `ArrowResultChunk.ArrowChunkIterator` Iterator class used to go through the arrow chunk row by row

### Nested classes/interfaces inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk

`SnowflakeResultChunk.DownloadState`

### Constructor Summary

Constructors
Constructor and Description
`ArrowResultChunk(String url, int rowCount, int colCount, int uncompressedSize, org.apache.arrow.memory.RootAllocator rootAllocator)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`long` `computeNeededChunkMemory()` Compute the memory necessary to store the data of this chunk
`void` `enableSortFirstResultChunk()`
`void` `freeData()` Free the data stored in this chunk.
`static ArrowResultChunk.ArrowChunkIterator` `getEmptyChunkIterator()`
`ArrowResultChunk.ArrowChunkIterator` `getIterator(DataConversionContext dataConversionContext)`
`void` `readArrowStream(InputStream is)` Read an inputStream of arrow data bytes and load them into java vectors of value.
`void` `reset()` Reset all data structure used in this result chunk

### Methods inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk

`getColCount, getDownloadCondition, getDownloadError, getDownloadState, getDownloadTime, getLock, getParseTime, getRowCount, getScrubbedUrl, getUncompressedSize, getUrl, setDownloadError, setDownloadState, setDownloadTime, setParseTime`

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

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

### Constructor Detail

#### ArrowResultChunk

    public ArrowResultChunk(String url,
                            int rowCount,
                            int colCount,
                            int uncompressedSize,
                            org.apache.arrow.memory.RootAllocator rootAllocator)

### Method Detail

#### readArrowStream

    public void readArrowStream(InputStream is)
                         throws IOException

Read an inputStream of arrow data bytes and load them into java vectors of value. Note, there is no copy of data involved once data is loaded into memory. a.k.a ArrowStreamReader originally allocates the memory to hold vectors, but those memory ownership is transfer into ArrowResultChunk class and once ArrowStreamReader is garbage collected, memory will not be cleared up

Parameters:
  `is` - inputStream which contains arrow data file in bytes
Throws:
  `IOException` - if failed to read data as arrow file

#### reset

    public void reset()

Description copied from class: `SnowflakeResultChunk`
Reset all data structure used in this result chunk

#### computeNeededChunkMemory

    public long computeNeededChunkMemory()

Description copied from class: `SnowflakeResultChunk`
Compute the memory necessary to store the data of this chunk

Returns:
  necessary memory in bytes

#### freeData

    public void freeData()

Description copied from class: `SnowflakeResultChunk`
Free the data stored in this chunk. Called when finish consuming the chunk

#### getIterator

    public ArrowResultChunk.ArrowChunkIterator getIterator(DataConversionContext dataConversionContext)

Returns:
  an iterator to iterate over current chunk

#### getEmptyChunkIterator

    public static ArrowResultChunk.ArrowChunkIterator getEmptyChunkIterator()

#### enableSortFirstResultChunk

    public void enableSortFirstResultChunk()