dzamo opened a new pull request #2264: URL: https://github.com/apache/drill/pull/2264
# [DRILL-7955](https://issues.apache.org/jira/browse/DRILL-7955): Extend XOR bitwise functions to match AND and OR ## Description The bitwise XOR function (^) is only implemented for Int while AND (&) and OR (|) are implemented for all widths of integer. Also there is no BIT_XOR aggregate while there are both BIT_AND and BIT_OR and all three operations are associative. This improvement proposes to bring XOR in line with AND and OR in both of these respects. E.g. without this patch we have ``` select `|`(cast(2 as bigint), cast(4 as bigint)) -- bitwise OR, works EXPR$0| ------| 6| select `^`(cast(2 as bigint), cast(4 as bigint)) -- bitwise XOR, breaks SQL Error: FUNCTION ERROR: ^ does not support operand types (BIGINT,BIGINT) ``` ## Documentation Descriptions of &, |, ^ and BIT_XOR will be added to the user docs. ## Testing Tests for LSHIFT, RSHIFT (two related and testless functions), XOR, BIT_XOR added to exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewAggregateFunctions.java -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
