Class Query

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Query
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Construct and execute read/write queries on a TileDB Array.

    Example:

    
     Query query = new Query(my_dense_array, TILEDB_WRITE);
     query.setLayout(TILEDB_GLOBAL_ORDER);
     query.setBuffer("a1", a1_data);
     NativeArray a1_data = new NativeArray(ctx, new int[] {1,2,3,4}, Integer.class);
     query.setBuffer("a1", a1_data);
     query.submit();
     
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addUpdateValue​(java.lang.String column, NativeArray value, java.math.BigInteger updateValueSize)
      Sets the update value.
      void close()
      Free's native TileDB resources associated with the Query object
      Query finalizeQuery()
      Flushes all internal state of a query object and finalizes the query.
      java.lang.Object getBuffer​(java.lang.String bufferName)
      Return a Java primitive array object as a copy of the attribute buffer
      Pair<java.nio.ByteBuffer,​java.nio.ByteBuffer> getBufferNIO​(java.lang.String attr)
      Retrieves the ByteBuffer of attribute attr
      byte[] getByteArray​(java.lang.String bufferName)
      Drains a ByteBuffer and returns its contents as a byte[] array
      Pair<java.nio.ByteBuffer,​java.nio.ByteBuffer> getByteBuffer​(java.lang.String attr)
      Deprecated.
      is replaced by getBufferNIO(String attr)
      Pair<java.nio.LongBuffer,​java.nio.CharBuffer> getCharBuffer​(java.lang.String bufferName)
      Retrieves the CharBuffer of an attribute bufferName of type Char
      Config getConfig()  
      QueryChannel getDefaultChannel()
      Gets the default channel of the query.
      Pair<java.nio.LongBuffer,​java.nio.DoubleBuffer> getDoubleBuffer​(java.lang.String bufferName)
      Retrieves the an DoubleBuffer of an attribute bufferName of type Double
      long getEstResultSize​(Context ctx, java.lang.String column)
      Retrieves the estimated result size for a fixed-sized attribute/dimension.
      Pair<java.lang.Long,​java.lang.Long> getEstResultSizeNullable​(Context ctx, java.lang.String column)
      Retrieves the estimated result size for a fixed-sized nullable attribute.
      Pair<java.lang.Long,​java.lang.Long> getEstResultSizeVar​(Context ctx, java.lang.String column)
      Retrieves the estimated result size for a var-sized attribute/dimension.
      Pair<Pair<java.lang.Long,​java.lang.Long>,​java.lang.Long> getEstResultSizeVarNullable​(Context ctx, java.lang.String column)
      Retrieves the estimated result size for a var-sized nullable attribute.
      Pair<java.nio.LongBuffer,​java.nio.FloatBuffer> getFloatBuffer​(java.lang.String bufferName)
      Retrieves the an FloatBuffer of an attribute bufferName of type Float
      long getFragmentNum()
      Retrieves the number of written fragments.
      Pair<java.lang.Long,​java.lang.Long> getFragmentTimestampRange​(java.math.BigInteger idx)  
      java.lang.String getFragmentURI​(java.math.BigInteger idx)
      Retrieves the URI of the written fragment with the input index.
      Pair<java.nio.LongBuffer,​java.nio.IntBuffer> getIntBuffer​(java.lang.String bufferName)
      Retrieves an IntBuffer of an attribute attr of type Integer
      Pair<java.nio.LongBuffer,​java.nio.LongBuffer> getLongBuffer​(java.lang.String bufferName)
      Retrieves a LongBuffer of an attribute bufferName of type Long
      long[] getOffsetArray​(java.lang.String bufferName)
      Deprecated.
      is replaced by getOffsetsBufferNIO(String bufferName)
      long[] getOffsetsBuffer​(java.lang.String bufferName)
      Return an array containing offsets for a variable attribute buffer
      long[] getOffsetsBufferNIO​(java.lang.String bufferName)
      Drains a variable-sized buffer and returns its offsets as a byte[] Array
      java.lang.String getPlan()
      Fetches a query plan string representation given a context and an unsubmitted yet fully formed query object.
      protected SWIGTYPE_p_tiledb_query_t getQueryp()  
      QueryStatus getQueryStatus()  
      long getRelevantFragmentNum()
      Get the number of relevant fragments from the subarray.
      java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> getResultEstimations()
      Returns the result size estimate for each attribute/dimension
      Pair<java.nio.LongBuffer,​java.nio.ShortBuffer> getShortBuffer​(java.lang.String bufferName)
      Retrieves the CharBuffer of an attribute bufferName of type Char
      java.lang.String getStats()  
      short[] getValidityBuffer​(java.lang.String attribute)
      Returns the validity buffer of a nullable attribute
      short[] getValidityByteMap​(java.lang.String attribute)
      Deprecated.
      is replaced by getValidityBuffer(String attribute)
      long[] getVarBuffer​(java.lang.String bufferName)
      Deprecated.
      is replaced by getOffsetsBuffer(String bufferName)
      void resetBuffers()
      Clears all attribute buffers.
      Query resetBufferSizes()
      Resets all attribute buffer sizes to zero
      Query resetBufferSizes​(java.lang.Long val)  
      java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> resultBufferElements()  
      Pair<java.lang.Long,​java.lang.Long> resultBufferElementsNIO​(java.lang.String name, int typeSize)  
      java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> resultBufferSizes()
      It is highly likely you want to use resultBufferElements.
      Query setBuffer​(java.lang.String attr, long bufferElements)
      Deprecated.
      Query setBuffer​(java.lang.String attr, NativeArray data)
      Deprecated.
      is replaced by setDataBuffer(attr, data);
      Query setBuffer​(java.lang.String attr, NativeArray offsets, NativeArray data)
      Deprecated.
      is replaced by these two: setDataBuffer(attr, data); setOffsetsBuffer(attr, offsets);
      Query setBufferByteSize​(java.lang.String attribute, java.lang.Long bufferSize)  
      Query setBufferByteSize​(java.lang.String attribute, java.lang.Long offsetSize, java.lang.Long bufferSize)  
      Query setBufferElements​(java.lang.String attribute, java.lang.Integer bufferElements)  
      Query setBufferElements​(java.lang.String attribute, java.lang.Integer offsetElements, java.lang.Integer bufferElements)  
      Query setBufferNullable​(java.lang.String attr, NativeArray data, NativeArray bytemap)
      Deprecated.
      is replaced by these two: setDataBuffer(attr, data); setValidityBuffer(attr, bytemap);
      Query setBufferNullable​(java.lang.String attr, NativeArray offsets, NativeArray data, NativeArray bytemap)
      Deprecated.
      is replaced by these three: setDataBuffer(attr, data); this.setOffsetsBuffer(attr, offsets); setValidityBuffer(attr, bytemap);
      void setCondition​(QueryCondition queryCondition)
      Sets the QueryCondition for the Query.
      Query setDataBuffer​(java.lang.String attr, long bufferElements)
      * Sets a NIO ByteBuffer
      Query setDataBuffer​(java.lang.String attr, NativeArray buffer)
      Sets the data buffer for a fixed-sized attribute or dimension.
      Query setDataBuffer​(java.lang.String attr, NativeArray buffer, long bufferElements)
      Sets the data buffer for a fixed-sized attribute.
      Query setDataBuffer​(java.lang.String attr, java.nio.ByteBuffer buffer)
      * Sets a NIO ByteBuffer
      Query setLayout​(Layout layout)
      Sets the data layout of the buffers.
      Query setOffsetsBuffer​(java.lang.String attr, NativeArray offsets)
      Sets an offsets buffer for a variable-sized getAttribute.
      Query setOffsetsBuffer​(java.lang.String attr, java.nio.ByteBuffer buffer)
      Sets an offsets buffer for a var-sized attribute.
      Query setSubarray​(SubArray subarray)
      Sets a subarray, defined in the order dimensions were added.
      Query setSubarray​(java.nio.ByteBuffer subarray)
      Sets a subarray, defined in the order dimensions were added.
      Query setValidityBuffer​(java.lang.String attr, NativeArray bytemap)
      Sets a validity byte-map for a fixed-sized attribute.
      Query setValidityBuffer​(java.lang.String attr, java.nio.ByteBuffer buffer)
      Sets a validity byte-map for an attribute.
      QueryStatus submit()
      Submits the query.
      QueryStatus submitAndFinalize()
      Submits and finalizes the query.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • setLayout

        public Query setLayout​(Layout layout)
                        throws TileDBError
        Sets the data layout of the buffers.
        Parameters:
        layout - The layout order to be set.
        Throws:
        TileDBError - A TileDB exception
      • submit

        public QueryStatus submit()
                           throws TileDBError
        Submits the query. Call will block until query is complete.
        Returns:
        The query Status.
        Throws:
        TileDBError - A TileDB exception
      • submitAndFinalize

        public QueryStatus submitAndFinalize()
                                      throws TileDBError
        Submits and finalizes the query. This is applicable only to global layout writes. The function will error out if called on a query with non global layout. Its purpose is to submit the final chunk (partial or full tile) in a global order write query. `tiledb_query_submit_and_finalize` drops the tile alignment restriction of the buffers (i.e. compared to the regular global layout submit call) given the last chunk of a global order write is most frequently smaller in size than a tile.
        Returns:
        The query Status.
        Throws:
        TileDBError - A TileDB exception
      • setSubarray

        public Query setSubarray​(SubArray subarray)
                          throws TileDBError
        Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive.
        Parameters:
        subarray - The targeted subarray.
        Throws:
        TileDBError - A TileDB exception
      • setSubarray

        public Query setSubarray​(java.nio.ByteBuffer subarray)
                          throws TileDBError
        Sets a subarray, defined in the order dimensions were added. Coordinates are inclusive.
        Parameters:
        subarray - The targeted subarray.
        Throws:
        TileDBError - A TileDB exception
      • addUpdateValue

        public void addUpdateValue​(java.lang.String column,
                                   NativeArray value,
                                   java.math.BigInteger updateValueSize)
                            throws TileDBError
        Sets the update value.

        Note that more than one update value may be set on a query.

        Parameters:
        column - The attribute name.
        value - The value to set.
        updateValueSize - The byte size of `update_value`.
        Throws:
        TileDBError
      • getEstResultSize

        public long getEstResultSize​(Context ctx,
                                     java.lang.String column)
                              throws TileDBError
        Retrieves the estimated result size for a fixed-sized attribute/dimension.
        Parameters:
        ctx - The TileDB Context
        column - The attribute/dimension name
        Returns:
        The estimated result size
        Throws:
        TileDBError
      • getRelevantFragmentNum

        public long getRelevantFragmentNum()
                                    throws TileDBError
        Get the number of relevant fragments from the subarray. Should only be called after size estimation was asked for.
        Returns:
        The number of relevant fragments.
        Throws:
        TileDBError
      • getDefaultChannel

        public QueryChannel getDefaultChannel()
                                       throws TileDBError
        Gets the default channel of the query. The default channel consists of all the rows the query would return as if executed standalone.
        Returns:
        The default channel
        Throws:
        TileDBError
      • getEstResultSizeVar

        public Pair<java.lang.Long,​java.lang.Long> getEstResultSizeVar​(Context ctx,
                                                                             java.lang.String column)
                                                                      throws TileDBError
        Retrieves the estimated result size for a var-sized attribute/dimension.
        Parameters:
        ctx - The TileDB Context
        column - The attribute/dimension name
        Returns:
        A Pair containing the estimated result size of the offsets and the data buffers
        Throws:
        TileDBError
      • getEstResultSizeVarNullable

        public Pair<Pair<java.lang.Long,​java.lang.Long>,​java.lang.Long> getEstResultSizeVarNullable​(Context ctx,
                                                                                                                java.lang.String column)
                                                                                                         throws TileDBError
        Retrieves the estimated result size for a var-sized nullable attribute.
        Parameters:
        ctx - The TileDB Context
        column - The attribute/dimension name
        Returns:
        A Pair containing another Pair with the estimated result size of the offsets and the data buffers, and the estimated result size of the validity buffer
        Throws:
        TileDBError
      • getEstResultSizeNullable

        public Pair<java.lang.Long,​java.lang.Long> getEstResultSizeNullable​(Context ctx,
                                                                                  java.lang.String column)
                                                                           throws TileDBError
        Retrieves the estimated result size for a fixed-sized nullable attribute.
        Parameters:
        ctx - The TileDB Context
        column - The attribute/dimension name
        Returns:
        The estimated result size
        Throws:
        TileDBError
      • setBuffer

        @Deprecated
        public Query setBuffer​(java.lang.String attr,
                               NativeArray data)
                        throws TileDBError
        Deprecated.
        is replaced by setDataBuffer(attr, data);
        Sets a buffer for a fixed-sized attribute or dimension.
        Parameters:
        attr - The attribute/dimension name.
        data - NativeBuffer to be used for the attribute values.
        Throws:
        TileDBError - A TileDB exception
      • setBuffer

        @Deprecated
        public Query setBuffer​(java.lang.String attr,
                               NativeArray offsets,
                               NativeArray data)
                        throws TileDBError
        Deprecated.
        is replaced by these two: setDataBuffer(attr, data); setOffsetsBuffer(attr, offsets);
        Sets a buffer for a variable-sized getAttribute.
        Parameters:
        attr - Attribute name
        offsets - Offsets where a new element begins in the data buffer.
        data - Buffer vector with elements of the attribute type.
        Throws:
        TileDBError - A TileDB exception
      • setBufferNullable

        @Deprecated
        public Query setBufferNullable​(java.lang.String attr,
                                       NativeArray data,
                                       NativeArray bytemap)
                                throws TileDBError
        Deprecated.
        is replaced by these two: setDataBuffer(attr, data); setValidityBuffer(attr, bytemap);
        Sets a nullable buffer for a fixed-sized attribute.
        Parameters:
        attr - The attribute name.
        data - NativeBuffer to be used for the attribute values.
        bytemap - The byte-map
        Throws:
        TileDBError - A TileDB exception
      • setBufferNullable

        @Deprecated
        public Query setBufferNullable​(java.lang.String attr,
                                       NativeArray offsets,
                                       NativeArray data,
                                       NativeArray bytemap)
                                throws TileDBError
        Deprecated.
        is replaced by these three: setDataBuffer(attr, data); this.setOffsetsBuffer(attr, offsets); setValidityBuffer(attr, bytemap);
        Sets a nullable buffer for a variable-sized getAttribute.
        Parameters:
        attr - Attribute name
        offsets - Offsets where a new element begins in the data buffer.
        data - Buffer vector with elements of the attribute type.
        bytemap - The byte-map
        Throws:
        TileDBError - A TileDB exception
      • setBuffer

        @Deprecated
        public Query setBuffer​(java.lang.String attr,
                               long bufferElements)
                        throws TileDBError
        Deprecated.
        * Sets a NIO ByteBuffer
        Parameters:
        attr - The attribute
        bufferElements -
        Returns:
        The NIO ByteBuffer
        Throws:
        TileDBError
      • setDataBuffer

        public Query setDataBuffer​(java.lang.String attr,
                                   NativeArray buffer)
                            throws TileDBError
        Sets the data buffer for a fixed-sized attribute or dimension.
        Parameters:
        attr - The attribute/dimension name.
        buffer - NativeBuffer to be used for the attribute values.
        Throws:
        TileDBError - A TileDB exception
      • setDataBuffer

        public Query setDataBuffer​(java.lang.String attr,
                                   NativeArray buffer,
                                   long bufferElements)
                            throws TileDBError
        Sets the data buffer for a fixed-sized attribute.
        Parameters:
        attr - The attribute name.
        buffer - NativeBuffer to be used for the attribute values.
        bufferElements - The actual number of buffer elements
        Throws:
        TileDBError - A TileDB exception
      • setValidityBuffer

        public Query setValidityBuffer​(java.lang.String attr,
                                       NativeArray bytemap)
                                throws TileDBError
        Sets a validity byte-map for a fixed-sized attribute.
        Parameters:
        attr - The attribute name.
        bytemap - The byte-map
        Throws:
        TileDBError - A TileDB exception
      • setValidityBuffer

        public Query setValidityBuffer​(java.lang.String attr,
                                       java.nio.ByteBuffer buffer)
                                throws TileDBError
        Sets a validity byte-map for an attribute.
        Parameters:
        attr - The attribute name.
        buffer - NativeBuffer to be used for the attribute values.
        Throws:
        TileDBError - A TileDB exception
      • setOffsetsBuffer

        public Query setOffsetsBuffer​(java.lang.String attr,
                                      java.nio.ByteBuffer buffer)
                               throws TileDBError
        Sets an offsets buffer for a var-sized attribute.
        Parameters:
        attr - The attribute name.
        buffer - NativeBuffer to be used for the attribute values.
        Throws:
        TileDBError - A TileDB exception
      • setDataBuffer

        public Query setDataBuffer​(java.lang.String attr,
                                   long bufferElements)
                            throws TileDBError
        * Sets a NIO ByteBuffer
        Parameters:
        attr - The attribute
        bufferElements - The number of elements to allocate
        Returns:
        The NIO ByteBuffer
        Throws:
        TileDBError
      • setDataBuffer

        public Query setDataBuffer​(java.lang.String attr,
                                   java.nio.ByteBuffer buffer)
                            throws TileDBError
        * Sets a NIO ByteBuffer
        Parameters:
        attr - The attribute
        buffer - The input NIO ByteBuffer
        Returns:
        The NIO ByteBuffer
        Throws:
        TileDBError
      • setOffsetsBuffer

        public Query setOffsetsBuffer​(java.lang.String attr,
                                      NativeArray offsets)
                               throws TileDBError
        Sets an offsets buffer for a variable-sized getAttribute.
        Parameters:
        attr - Attribute name
        offsets - Offsets where a new element begins in the data buffer.
        Throws:
        TileDBError - A TileDB exception
      • setBufferByteSize

        public Query setBufferByteSize​(java.lang.String attribute,
                                       java.lang.Long offsetSize,
                                       java.lang.Long bufferSize)
                                throws TileDBError
        Throws:
        TileDBError
      • setBufferByteSize

        public Query setBufferByteSize​(java.lang.String attribute,
                                       java.lang.Long bufferSize)
                                throws TileDBError
        Throws:
        TileDBError
      • setBufferElements

        public Query setBufferElements​(java.lang.String attribute,
                                       java.lang.Integer bufferElements)
                                throws TileDBError
        Throws:
        TileDBError
      • setBufferElements

        public Query setBufferElements​(java.lang.String attribute,
                                       java.lang.Integer offsetElements,
                                       java.lang.Integer bufferElements)
                                throws TileDBError
        Throws:
        TileDBError
      • resultBufferElementsNIO

        public Pair<java.lang.Long,​java.lang.Long> resultBufferElementsNIO​(java.lang.String name,
                                                                                 int typeSize)
                                                                          throws TileDBError
        Parameters:
        typeSize - the typeSize of the attribute/dimension
        name - attribute/dimension name
        Returns:
        The number of elements in the result NIO buffers for a specific attribute.

        The first is number of elements for var size attributes, and the second is number of elements in the data buffer. For fixed sized attributes (and coordinates), the first is always 0.

        Throws:
        TileDBError - A TileDB exception
      • resultBufferElements

        public java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> resultBufferElements()
                                                                                                                 throws TileDBError
        Returns:
        The number of elements in the result buffers. This is a map from the attribute name to a pair of values.

        The first is number of elements for var size attributes, and the second is number of elements in the data buffer. For fixed sized attributes (and coordinates), the first is always 0.

        Throws:
        TileDBError - A TileDB exception
      • resultBufferSizes

        public java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> resultBufferSizes()
                                                                                                              throws TileDBError
        It is highly likely you want to use resultBufferElements.

        resultBufferSizes used mostly for metric reporting.

        Returns:
        The size in bytes of the result buffers. This is a map from the attribute name to a pair of values.

        The first is size in bytes for offsets of var size attributes, and the second is size in bytes in the data buffer. For fixed sized attributes (and coordinates), the first is always 0.

        Throws:
        TileDBError - A TileDB exception
      • resetBuffers

        public void resetBuffers()
        Clears all attribute buffers.
      • resetBufferSizes

        public Query resetBufferSizes​(java.lang.Long val)
      • resetBufferSizes

        public Query resetBufferSizes()
        Resets all attribute buffer sizes to zero
      • getBuffer

        public java.lang.Object getBuffer​(java.lang.String bufferName)
                                   throws TileDBError
        Return a Java primitive array object as a copy of the attribute buffer
        Parameters:
        bufferName - attribute name
        Returns:
        A Java array
        Throws:
        TileDBError - A TileDB exception
      • getBufferNIO

        public Pair<java.nio.ByteBuffer,​java.nio.ByteBuffer> getBufferNIO​(java.lang.String attr)
                                                                         throws TileDBError
        Retrieves the ByteBuffer of attribute attr
        Parameters:
        attr - The attribute name
        Returns:
        The ByteBuffer
        Throws:
        TileDBError - A TileDB exception
      • getByteBuffer

        @Deprecated
        public Pair<java.nio.ByteBuffer,​java.nio.ByteBuffer> getByteBuffer​(java.lang.String attr)
                                                                          throws TileDBError
        Deprecated.
        is replaced by getBufferNIO(String attr)
        Retrieves the ByteBuffer of attribute attr
        Parameters:
        attr - The attribute name
        Returns:
        The ByteBuffer @Deprecated is replaced by getBufferNIO(String attr)
        Throws:
        TileDBError - A TileDB exception
      • getVarBuffer

        @Deprecated
        public long[] getVarBuffer​(java.lang.String bufferName)
                            throws TileDBError
        Deprecated.
        is replaced by getOffsetsBuffer(String bufferName)
        Return an array containing offsets for a variable attribute buffer
        Parameters:
        bufferName - attribute name
        Returns:
        A Java long[] array
        Throws:
        TileDBError - A TileDB exception
      • getOffsetsBuffer

        public long[] getOffsetsBuffer​(java.lang.String bufferName)
                                throws TileDBError
        Return an array containing offsets for a variable attribute buffer
        Parameters:
        bufferName - attribute name
        Returns:
        A Java long[] array
        Throws:
        TileDBError - A TileDB exception
      • getIntBuffer

        public Pair<java.nio.LongBuffer,​java.nio.IntBuffer> getIntBuffer​(java.lang.String bufferName)
                                                                        throws TileDBError
        Retrieves an IntBuffer of an attribute attr of type Integer
        Parameters:
        bufferName - The attribute name
        Returns:
        The IntBuffer
        Throws:
        TileDBError - A TileDB exception
      • getLongBuffer

        public Pair<java.nio.LongBuffer,​java.nio.LongBuffer> getLongBuffer​(java.lang.String bufferName)
                                                                          throws TileDBError
        Retrieves a LongBuffer of an attribute bufferName of type Long
        Parameters:
        bufferName - The attribute name
        Returns:
        The IntBuffer
        Throws:
        TileDBError - A TileDB exception
      • getShortBuffer

        public Pair<java.nio.LongBuffer,​java.nio.ShortBuffer> getShortBuffer​(java.lang.String bufferName)
                                                                            throws TileDBError
        Retrieves the CharBuffer of an attribute bufferName of type Char
        Parameters:
        bufferName - The attribute name
        Returns:
        The CharBuffer
        Throws:
        TileDBError - A TileDB exception
      • getCharBuffer

        public Pair<java.nio.LongBuffer,​java.nio.CharBuffer> getCharBuffer​(java.lang.String bufferName)
                                                                          throws TileDBError
        Retrieves the CharBuffer of an attribute bufferName of type Char
        Parameters:
        bufferName - The attribute name
        Returns:
        The CharBuffer
        Throws:
        TileDBError - A TileDB exception
      • getFloatBuffer

        public Pair<java.nio.LongBuffer,​java.nio.FloatBuffer> getFloatBuffer​(java.lang.String bufferName)
                                                                            throws TileDBError
        Retrieves the an FloatBuffer of an attribute bufferName of type Float
        Parameters:
        bufferName - The attribute name
        Returns:
        The FloatBuffer
        Throws:
        TileDBError - A TileDB exception
      • getDoubleBuffer

        public Pair<java.nio.LongBuffer,​java.nio.DoubleBuffer> getDoubleBuffer​(java.lang.String bufferName)
                                                                              throws TileDBError
        Retrieves the an DoubleBuffer of an attribute bufferName of type Double
        Parameters:
        bufferName - The attribute name
        Returns:
        The DoubleBuffer
        Throws:
        TileDBError - A TileDB exception
      • getByteArray

        public byte[] getByteArray​(java.lang.String bufferName)
                            throws TileDBError
        Drains a ByteBuffer and returns its contents as a byte[] array
        Parameters:
        bufferName - The attribute name
        Returns:
        The byte[] array
        Throws:
        TileDBError - A TileDB exception
      • getOffsetsBufferNIO

        public long[] getOffsetsBufferNIO​(java.lang.String bufferName)
                                   throws TileDBError
        Drains a variable-sized buffer and returns its offsets as a byte[] Array
        Parameters:
        bufferName - The attribute name
        Returns:
        The byte[] array
        Throws:
        TileDBError - A TileDB exception
      • getOffsetArray

        @Deprecated
        public long[] getOffsetArray​(java.lang.String bufferName)
                              throws TileDBError
        Deprecated.
        is replaced by getOffsetsBufferNIO(String bufferName)
        Drains a variable-sized buffer and returns its offsets as a byte[] Array
        Parameters:
        bufferName - The attribute name
        Returns:
        The byte[] array
        Throws:
        TileDBError - A TileDB exception
      • getPlan

        public java.lang.String getPlan()
                                 throws TileDBError
        Fetches a query plan string representation given a context and an unsubmitted yet fully formed query object. The returned query plan is represented as valid JSON, but the API is still experimental, there is no JSON schema describing it and the content of the returned query plan will most likely change.
        Returns:
        The plan.
        Throws:
        TileDBError - A TileDB exception
      • getValidityBuffer

        public short[] getValidityBuffer​(java.lang.String attribute)
                                  throws TileDBError
        Returns the validity buffer of a nullable attribute
        Parameters:
        attribute - name of the attribute
        Returns:
        The buffer as a short[] array
        Throws:
        TileDBError
      • getValidityByteMap

        @Deprecated
        public short[] getValidityByteMap​(java.lang.String attribute)
                                   throws TileDBError
        Deprecated.
        is replaced by getValidityBuffer(String attribute)
        Returns the validity buffer of a nullable attribute
        Parameters:
        attribute - name of the attribute
        Returns:
        The buffer as a short[] array
        Throws:
        TileDBError
      • getResultEstimations

        public java.util.HashMap<java.lang.String,​Pair<java.lang.Long,​java.lang.Long>> getResultEstimations()
                                                                                                                 throws TileDBError
        Returns the result size estimate for each attribute/dimension
        Returns:
        A HashMap with Pairs, where the first value of the pair is the estimated size of the offsets (in case of variable-sized attributes) and the second value represents the data size estimate.
        Throws:
        TileDBError
      • finalizeQuery

        public Query finalizeQuery()
                            throws TileDBError
        Flushes all internal state of a query object and finalizes the query. This is applicable only to global layout writes. It has no effect for any other query type.
        Returns:
        Finalized query instance
        Throws:
        TileDBError - A TileDB excdeption
      • getFragmentNum

        public long getFragmentNum()
                            throws TileDBError
        Retrieves the number of written fragments. Applicable only to WRITE queries.
        Returns:
        The number of written fragments
        Throws:
        TileDBError
      • getFragmentURI

        public java.lang.String getFragmentURI​(java.math.BigInteger idx)
                                        throws TileDBError
        Retrieves the URI of the written fragment with the input index. Applicable only to WRITE queries.
        Returns:
        The URI
        Throws:
        TileDBError
      • getFragmentTimestampRange

        public Pair<java.lang.Long,​java.lang.Long> getFragmentTimestampRange​(java.math.BigInteger idx)
                                                                            throws TileDBError
        Throws:
        TileDBError
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getStats

        public java.lang.String getStats()
                                  throws TileDBError
        Returns:
        Retrieves the stats from a Query.
        Throws:
        TileDBError - A TileDB exception
      • setCondition

        public void setCondition​(QueryCondition queryCondition)
                          throws TileDBError
        Sets the QueryCondition for the Query.
        Parameters:
        queryCondition -
        Throws:
        TileDBError
      • getConfig

        public Config getConfig()
                         throws TileDBError
        Returns:
        Retrieves the config from a Query.
        Throws:
        TileDBError - A TileDB exception
      • close

        public void close()
        Free's native TileDB resources associated with the Query object
        Specified by:
        close in interface java.lang.AutoCloseable