Class ArrowResultChunk

    • Constructor Detail

      • ArrowResultChunk

        public ArrowResultChunk​(String url,
                                int rowCount,
                                int colCount,
                                int uncompressedSize,
                                org.apache.arrow.memory.RootAllocator rootAllocator,
                                SFBaseSession session)
    • 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()
      • computeNeededChunkMemory

        public long computeNeededChunkMemory()
      • freeData

        public void freeData()
      • enableSortFirstResultChunk

        public void enableSortFirstResultChunk()
      • mergeBatchesIntoOne

        public void mergeBatchesIntoOne()
                                 throws SnowflakeSQLException
        merge arrow result chunk with more than one batches into one record batch (Only used for the first chunk when client side sorting is required)
        Throws:
        SnowflakeSQLException