This is an automated email from the ASF dual-hosted git repository.

xuzifu666 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new fe73166a17 [CALCITE-7352] Incorrect SqlLibrary enum value used in 
ClickHouse SQL test
fe73166a17 is described below

commit fe73166a17232a7bcbb3ed5c01a08b2f98101980
Author: Zhen Chen <[email protected]>
AuthorDate: Sun Jan 4 09:32:11 2026 +0800

    [CALCITE-7352] Incorrect SqlLibrary enum value used in ClickHouse SQL test
---
 .../main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java    | 5 +++--
 .../java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java   | 4 ++--
 site/_docs/reference.md                                              | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java 
b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
index f8f4e9273b..f7f7029ae4 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
@@ -64,6 +64,7 @@
 import static org.apache.calcite.sql.fun.SqlLibrary.ALL;
 import static org.apache.calcite.sql.fun.SqlLibrary.BIG_QUERY;
 import static org.apache.calcite.sql.fun.SqlLibrary.CALCITE;
+import static org.apache.calcite.sql.fun.SqlLibrary.CLICKHOUSE;
 import static org.apache.calcite.sql.fun.SqlLibrary.HIVE;
 import static org.apache.calcite.sql.fun.SqlLibrary.MSSQL;
 import static org.apache.calcite.sql.fun.SqlLibrary.MYSQL;
@@ -424,7 +425,7 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
           OperandTypes.STRING_SAME_SAME);
 
   /** The "ENDSWITH(value1, value2)" function (Snowflake). */
-  @LibraryOperator(libraries = {SNOWFLAKE, SPARK})
+  @LibraryOperator(libraries = {SNOWFLAKE, SPARK, CLICKHOUSE})
   public static final SqlFunction ENDSWITH = ENDS_WITH.withName("ENDSWITH");
 
   /** The "STARTS_WITH(value1, value2)" function (BigQuery, PostgreSQL). */
@@ -434,7 +435,7 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
           OperandTypes.STRING_SAME_SAME);
 
   /** The "STARTSWITH(value1, value2)" function (Snowflake). */
-  @LibraryOperator(libraries = {SNOWFLAKE, SPARK})
+  @LibraryOperator(libraries = {SNOWFLAKE, SPARK, CLICKHOUSE})
   public static final SqlFunction STARTSWITH = 
STARTS_WITH.withName("STARTSWITH");
 
   /** BigQuery's "SUBSTR(string, position [, substringLength ])" function. */
diff --git 
a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java 
b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
index 43e8555924..27e9c23fec 100644
--- 
a/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
+++ 
b/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
@@ -8414,7 +8414,7 @@ private void checkLiteral2(String expression, String 
expected) {
     
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withPostgresql().ok(expectedPostgres);
     
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withSnowflake().ok(expectedSnowflake);
     sql(query).withLibrary(SqlLibrary.SPARK).withSpark().ok(expectedSpark);
-    
sql(query).withLibrary(SqlLibrary.SPARK).withClickHouse().ok(expectedClickHouse);
+    
sql(query).withLibrary(SqlLibrary.CLICKHOUSE).withClickHouse().ok(expectedClickHouse);
   }
 
   /** Test case for
@@ -8463,7 +8463,7 @@ private void checkLiteral2(String expression, String 
expected) {
     
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withPostgresql().ok(expectedPostgres);
     
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withSnowflake().ok(expectedSnowflake);
     sql(query).withLibrary(SqlLibrary.SPARK).withSpark().ok(expectedSpark);
-    
sql(query).withLibrary(SqlLibrary.SPARK).withClickHouse().ok(expectedClickHouse);
+    
sql(query).withLibrary(SqlLibrary.CLICKHOUSE).withClickHouse().ok(expectedClickHouse);
   }
 
   /** Test case for
diff --git a/site/_docs/reference.md b/site/_docs/reference.md
index 617ce1a83b..643cb69f18 100644
--- a/site/_docs/reference.md
+++ b/site/_docs/reference.md
@@ -2920,7 +2920,7 @@ ### Dialect-specific Operators
 | b | DATE_TRUNC(date, timeUnit)                     | Truncates *date* to the 
granularity of *timeUnit*, rounding to the beginning of the unit
 | o r s h | DECODE(value, value1, result1 [, valueN, resultN ]* [, default ]) 
| Compares *value* to each *valueN* value one by one; if *value* is equal to a 
*valueN*, returns the corresponding *resultN*, else returns *default*, or NULL 
if *default* is not specified
 | p r | DIFFERENCE(string, string)                   | Returns a measure of 
the similarity of two strings, namely the number of character positions that 
their `SOUNDEX` values have in common: 4 if the `SOUNDEX` values are same and 0 
if the `SOUNDEX` values are totally different
-| f s | ENDSWITH(string1, string2)                   | Returns whether 
*string2* is a suffix of *string1*
+| f s i | ENDSWITH(string1, string2)                   | Returns whether 
*string2* is a suffix of *string1*
 | b | ENDS_WITH(string1, string2)                    | Equivalent to 
`ENDSWITH(string1, string2)`
 | s | EXISTS(array, func)                            | Returns whether a 
predicate *func* holds for one or more elements in the *array*
 | o | EXISTSNODE(xml, xpath, [, namespaces ])        | Determines whether 
traversal of a XML document using a specified xpath results in any nodes. 
Returns 0 if no nodes remain after applying the XPath traversal on the document 
fragment of the element or elements matched by the XPath expression. Returns 1 
if any nodes remain. The optional namespace value that specifies a default 
mapping or namespace mapping for prefixes, which is used when evaluating the 
XPath expression.
@@ -3041,7 +3041,7 @@ ### Dialect-specific Operators
 | m s h | SPACE(integer)                               | Returns a string of 
*integer* spaces; returns an empty string if *integer* is less than 1
 | b | SPLIT(string [, delimiter ])                   | Returns the string 
array of *string* split at *delimiter* (if omitted, default is comma).  If the 
*string* is empty it returns an empty array, otherwise, if the *delimiter* is 
empty, it returns an array containing the original *string*.
 | p | SPLIT_PART(string, delimiter, n)               | Returns the *n*th field 
in *string* using *delimiter*; returns empty string if *n* is less than 1 or 
greater than the number of fields, and the n can be negative to count from the 
end.
-| f s | STARTSWITH(string1, string2)                 | Returns whether 
*string2* is a prefix of *string1*
+| f s i | STARTSWITH(string1, string2)                 | Returns whether 
*string2* is a prefix of *string1*
 | b p | STARTS_WITH(string1, string2)                | Equivalent to 
`STARTSWITH(string1, string2)`
 | m | STRCMP(string, string)                         | Returns 0 if both of 
the strings are same and returns -1 when the first argument is smaller than the 
second and 1 when the second one is smaller than the first one
 | b r p | STRPOS(string, substring)                  | Equivalent to 
`POSITION(substring IN string)`

Reply via email to