nielspardon commented on code in PR #5073:
URL: https://github.com/apache/calcite/pull/5073#discussion_r3536823564
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java:
##########
@@ -1396,6 +1396,35 @@ public class SqlStdOperatorTable extends
ReflectiveSqlOperatorTable {
OperandTypes.family(SqlTypeFamily.BINARY, SqlTypeFamily.INTEGER),
OperandTypes.family(SqlTypeFamily.UNSIGNED_NUMERIC,
SqlTypeFamily.INTEGER)));
+ /**
+ * <code>{@code >>}</code> (right shift) operator.
+ */
+ public static final SqlBinaryOperator BIT_RIGHT_SHIFT =
+ new SqlBinaryOperator(
+ ">>",
+ SqlKind.OTHER,
+ 32, // Standard shift operator
precedence
+ true,
+ ReturnTypes.ARG0_NULLABLE,
+ InferTypes.FIRST_KNOWN,
+ OperandTypes.or(
+ OperandTypes.family(SqlTypeFamily.INTEGER,
SqlTypeFamily.INTEGER),
+ OperandTypes.family(SqlTypeFamily.BINARY, SqlTypeFamily.INTEGER),
+ OperandTypes.family(SqlTypeFamily.UNSIGNED_NUMERIC,
SqlTypeFamily.INTEGER)));
+
+ /**
+ * right shift function.
+ */
+ public static final SqlFunction RIGHTSHIFT =
+ SqlBasicFunction.create(
+ "RIGHTSHIFT",
+ SqlKind.OTHER_FUNCTION,
+ ReturnTypes.ARG0_NULLABLE,
+ OperandTypes.or(
Review Comment:
Factored this out into a `SHIFT_OPERAND_TYPE_CHECKER` that is being reused.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]