wangxlong commented on a change in pull request #1878: [CALCITE-3782]Bitwise agg operator Bit_And, Bit_OR and Bit_XOR support binary and varbinary type URL: https://github.com/apache/calcite/pull/1878#discussion_r409588576
########## File path: core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java ########## @@ -9096,6 +9114,12 @@ protected void checkAggType(SqlTester tester, String expr, String type) { false); final String[] values = {"1", "2", "1"}; tester.checkAgg("bit_xor(x)", values, 2, 0); + final String[] binaryValues = { + "CAST(x'01' AS BINARY)", + "cast(x'02' as BINARY)", + "cast(x'01' AS BINARY)", + "cast(null AS BINARY)"}; + tester.checkAgg("bit_xor(x)", binaryValues, "02", 0); Review comment: You are right. Distinct for BIT_XOR isn't work. For SqlBitOpAggFunction#getDistinctOptionality is Optionality.IGNORED. So I think, for BIT_AND and BIT_OR, We can set Optionality.IGNORED. And for BIT_XOR, We can set Optionality.OPTIONAL. What do you think of it? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services