Class ByteFunctionHelpers
java.lang.Object
org.apache.drill.exec.expr.fn.impl.ByteFunctionHelpers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final int
Helper function to compare a set of bytes in DrillBuf to a ByteArray.static final int
Helper function to compare a set of bytes in two DrillBuffers.static final int
Helper function to check for equality of bytes in two DrillBuffersstatic int
getInteger
(byte[] b, int index) static int
getInteger
(byte[] b, int index, boolean ignoreSign) static boolean
getSign
(byte[] b) static void
setInteger
(byte[] b, int index, int value) static void
setSign
(byte[] b, boolean sign)
-
Constructor Details
-
ByteFunctionHelpers
public ByteFunctionHelpers()
-
-
Method Details
-
equal
public static final int equal(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd) Helper function to check for equality of bytes in two DrillBuffers- Parameters:
left
- Left DrillBuf for comparisonlStart
- start offset in the bufferlEnd
- end offset in the bufferright
- Right DrillBuf for comparisonrStart
- start offset in the bufferrEnd
- end offset in the buffer- Returns:
- 1 if left input is greater, -1 if left input is smaller, 0 otherwise
-
compare
public static final int compare(DrillBuf left, int lStart, int lEnd, DrillBuf right, int rStart, int rEnd) Helper function to compare a set of bytes in two DrillBuffers. Function will check data before completing in the case that- Parameters:
left
- Left DrillBuf to comparelStart
- start offset in the bufferlEnd
- end offset in the bufferright
- Right DrillBuf to comparerStart
- start offset in the bufferrEnd
- end offset in the buffer- Returns:
- 1 if left input is greater, -1 if left input is smaller, 0 otherwise
-
compare
public static final int compare(DrillBuf left, int lStart, int lEnd, byte[] right, int rStart, int rEnd) Helper function to compare a set of bytes in DrillBuf to a ByteArray.- Parameters:
left
- Left DrillBuf for comparison purposeslStart
- start offset in the bufferlEnd
- end offset in the bufferright
- second input to be comparedrStart
- start offset in the byte arrayrEnd
- end offset in the byte array- Returns:
- 1 if left input is greater, -1 if left input is smaller, 0 otherwise
-
getInteger
public static int getInteger(byte[] b, int index) -
getInteger
public static int getInteger(byte[] b, int index, boolean ignoreSign) -
setInteger
public static void setInteger(byte[] b, int index, int value) -
setSign
public static void setSign(byte[] b, boolean sign) -
getSign
public static boolean getSign(byte[] b)
-