mihaibudiu commented on code in PR #4930:
URL: https://github.com/apache/calcite/pull/4930#discussion_r3336365513


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -2800,4 +2800,54 @@ private static RelDataType 
deriveTypeMapFromEntries(SqlOperatorBinding opBinding
               OperandTypes.family(SqlTypeFamily.TIMESTAMP),
               OperandTypes.family(SqlTypeFamily.TIMESTAMP, 
SqlTypeFamily.TIMESTAMP)),
           SqlFunctionCategory.TIMEDATE);
+
+  /**
+   * The PostgreSQL {@code @>} (contains) operator.
+   *
+   * <p>This operator is polymorphic in PostgreSQL:
+   * <ul>
+   *   <li>ARRAY: checks if left array contains all elements of right 
array</li>
+   *   <li>RANGE: checks if left range contains the right value/range</li>
+   *   <li>JSONB: checks if left JSON document contains the right JSON 
document</li>
+   * </ul>
+   *
+   * @see <a 
href="https://www.postgresql.org/docs/current/functions-array.html";>
+   * PostgreSQL Array Functions</a>
+   * @see <a href="https://www.postgresql.org/docs/current/rangetypes.html";>
+   * PostgreSQL Range Types</a>
+   * @see <a 
href="https://www.postgresql.org/docs/current/functions-json.html";>
+   * PostgreSQL JSON Functions</a>
+   */
+  @LibraryOperator(libraries = {POSTGRESQL})
+  public static final SqlBinaryOperator CONTAINS_OP =

Review Comment:
   You take types ANY_ANY, which means that this will validate for non-array 
types, or for array types that have different element types. I think the type 
checking needs to be improved.



-- 
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]

Reply via email to