Package org.apache.iceberg.util
Class BinaryUtil
java.lang.Object
org.apache.iceberg.util.BinaryUtil
- 
Method SummaryModifier and TypeMethodDescriptionstatic ByteBuffertruncateBinary(ByteBuffer input, int length) Truncates the input byte buffer to the given length.static ByteBuffertruncateBinaryMax(ByteBuffer inputBuffer, int length) Returns a byte buffer whose length is lesser than or equal to truncateLength and is greater than the given inputstatic Literal<ByteBuffer> truncateBinaryMax(Literal<ByteBuffer> input, int length) Returns a byte buffer whose length is lesser than or equal to truncateLength and is greater than the given inputstatic ByteBuffertruncateBinaryMin(ByteBuffer input, int length) Returns a byte buffer whose length is lesser than or equal to truncateLength and is lower than the given inputstatic Literal<ByteBuffer> truncateBinaryMin(Literal<ByteBuffer> input, int length) Returns a byte buffer whose length is lesser than or equal to truncateLength and is lower than the given inputstatic ByteBuffertruncateBinaryUnsafe(ByteBuffer value, int width) Truncates the input byte buffer to the given length.
- 
Method Details- 
truncateBinaryTruncates the input byte buffer to the given length.We allow for a length of zero so that rows with empty string can be evaluated. Partition specs still cannot be created with a length of zero due to a constraint when parsing column truncation specs in org.apache.iceberg.MetricsModes.- Parameters:
- input- The ByteBuffer to be truncated
- length- The non-negative length to truncate input to
 
- 
truncateBinaryUnsafeTruncates the input byte buffer to the given length.Unlike truncateBinary(ByteBuffer, int), this skips copying the input data. - Parameters:
- value- The ByteBuffer to be truncated
- width- The non-negative length to truncate input to
 
- 
truncateBinaryMinReturns a byte buffer whose length is lesser than or equal to truncateLength and is lower than the given input
- 
truncateBinaryMinReturns a byte buffer whose length is lesser than or equal to truncateLength and is lower than the given input
- 
truncateBinaryMaxReturns a byte buffer whose length is lesser than or equal to truncateLength and is greater than the given input
- 
truncateBinaryMaxReturns a byte buffer whose length is lesser than or equal to truncateLength and is greater than the given input
 
-