Package org.apache.orc.impl
Class DictionaryUtils
java.lang.Object
org.apache.orc.impl.DictionaryUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static ByteBuffer
getTextInternal
(int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray) Return aByteBuffer
containing the data at a certain offset within aDynamicByteArray
.static void
getTextInternal
(Text result, int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray) Obtain the UTF8 string from the byteArray using the offset in index-array.static int
writeToTextInternal
(OutputStream out, int position, DynamicIntArray keyOffsets, DynamicByteArray byteArray) Write a UTF8 string from the byteArray, using the offset in index-array, into an OutputStream
-
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 keyOffsetskeyOffsets
- 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 aByteBuffer
containing the data at a certain offset within aDynamicByteArray
.- Parameters:
position
- position in the keyOffsetskeyOffsets
- starting offset of the key (in byte) in the byte arraybyteArray
- 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 streamposition
- position in the keyOffsetskeyOffsets
- starting offset of the key (in byte) in the byte arraybyteArray
- 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 foroffset
- the offset in the arraylength
- the number of bytes to search forposition
- position in the keyOffsetskeyOffsets
- starting offset of the key (in byte) in the byte arraybyteArray
- storing raw bytes of all key seen in dictionary- Returns:
- true if the text is equal to the value within the byteArray; false otherwise
-