Class DictionaryUtils

java.lang.Object
org.apache.orc.impl.DictionaryUtils

public class DictionaryUtils extends Object
  • Method Details

    • getTextInternal

      public static void getTextInternal(Text result, int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray)
      Obtain the UTF8 string from the byteArray using the offset in index-array.
      Parameters:
      result - Container for the UTF8 String.
      position - position in the keyOffsets
      keyOffsets - starting offset of the key (in byte) in the byte array.
      byteArray - storing raw bytes of all keys seen in dictionary
    • getTextInternal

      public static ByteBuffer getTextInternal(int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray)
      Return a ByteBuffer containing the data at a certain offset within a DynamicByteArray.
      Parameters:
      position - position in the keyOffsets
      keyOffsets - starting offset of the key (in byte) in the byte array
      byteArray - storing raw bytes of all keys seen in dictionary
      Returns:
      the number of bytes written to the output stream
    • writeToTextInternal

      public static int writeToTextInternal(OutputStream out, int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray) throws IOException
      Write a UTF8 string from the byteArray, using the offset in index-array, into an OutputStream
      Parameters:
      out - the output stream
      position - position in the keyOffsets
      keyOffsets - starting offset of the key (in byte) in the byte array
      byteArray - storing raw bytes of all keys seen in dictionary
      Returns:
      the number of bytes written to the output stream
      Throws:
      IOException - if an I/O error occurs
    • equalsInternal

      public static boolean equalsInternal(byte[] bytes, int offset, int length, int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray)
      Compare a UTF8 string from the byteArray using the offset in index-array.
      Parameters:
      bytes - an array containing bytes to search for
      offset - the offset in the array
      length - the number of bytes to search for
      position - position in the keyOffsets
      keyOffsets - starting offset of the key (in byte) in the byte array
      byteArray - storing raw bytes of all key seen in dictionary
      Returns:
      true if the text is equal to the value within the byteArray; false otherwise