xuzifu666 commented on code in PR #4818:
URL: https://github.com/apache/calcite/pull/4818#discussion_r2928547686


##########
core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java:
##########
@@ -463,4 +445,22 @@ public ClickHouseSqlArrayTypeNameSpec(SqlTypeNameSpec 
elementTypeName,
       writer.endList(frame);
     }
   }
+
+  /**
+   * Unparses REGEXP function calls by converting from function call format
+   * (e.g., REGEXP(column, pattern)) to infix operator format (e.g., column 
REGEXP pattern).
+   */
+  public static void unparseRegexp(SqlWriter writer, SqlCall call, int 
leftPrec, int rightPrec) {
+    if (call.operandCount() != 2) {
+      throw new IllegalArgumentException("REGEXP operator requires exactly 2 
operands");

Review Comment:
   This line of code was not covered by tests.



##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -705,11 +705,10 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
   public static final SqlFunction REGEXP_SUBSTR = 
REGEXP_EXTRACT.withName("REGEXP_SUBSTR");
 
   /** The "REGEXP(value, regexp)" function, equivalent to {@link #RLIKE}. */
-  @LibraryOperator(libraries = {SPARK})
+  @LibraryOperator(libraries = {SPARK, HIVE})

Review Comment:
   Since it's been added to libraries in this PR, Hive should also be added to 
SqlOperatorTest.



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