Skip to content

Commit cb2b27e

Browse files
committed
[CALCITE-7352] Incorrect SqlLibrary enum value used in ClickHouse SQL test
1 parent 3d14332 commit cb2b27e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import static org.apache.calcite.sql.fun.SqlLibrary.ALL;
6565
import static org.apache.calcite.sql.fun.SqlLibrary.BIG_QUERY;
6666
import static org.apache.calcite.sql.fun.SqlLibrary.CALCITE;
67+
import static org.apache.calcite.sql.fun.SqlLibrary.CLICKHOUSE;
6768
import static org.apache.calcite.sql.fun.SqlLibrary.HIVE;
6869
import static org.apache.calcite.sql.fun.SqlLibrary.MSSQL;
6970
import static org.apache.calcite.sql.fun.SqlLibrary.MYSQL;
@@ -424,7 +425,7 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding operatorBinding,
424425
OperandTypes.STRING_SAME_SAME);
425426

426427
/** The "ENDSWITH(value1, value2)" function (Snowflake). */
427-
@LibraryOperator(libraries = {SNOWFLAKE, SPARK})
428+
@LibraryOperator(libraries = {SNOWFLAKE, SPARK, CLICKHOUSE})
428429
public static final SqlFunction ENDSWITH = ENDS_WITH.withName("ENDSWITH");
429430

430431
/** The "STARTS_WITH(value1, value2)" function (BigQuery, PostgreSQL). */
@@ -434,7 +435,7 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding operatorBinding,
434435
OperandTypes.STRING_SAME_SAME);
435436

436437
/** The "STARTSWITH(value1, value2)" function (Snowflake). */
437-
@LibraryOperator(libraries = {SNOWFLAKE, SPARK})
438+
@LibraryOperator(libraries = {SNOWFLAKE, SPARK, CLICKHOUSE})
438439
public static final SqlFunction STARTSWITH = STARTS_WITH.withName("STARTSWITH");
439440

440441
/** BigQuery's "SUBSTR(string, position [, substringLength ])" function. */

core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8414,7 +8414,7 @@ private void checkLiteral2(String expression, String expected) {
84148414
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withPostgresql().ok(expectedPostgres);
84158415
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withSnowflake().ok(expectedSnowflake);
84168416
sql(query).withLibrary(SqlLibrary.SPARK).withSpark().ok(expectedSpark);
8417-
sql(query).withLibrary(SqlLibrary.SPARK).withClickHouse().ok(expectedClickHouse);
8417+
sql(query).withLibrary(SqlLibrary.CLICKHOUSE).withClickHouse().ok(expectedClickHouse);
84188418
}
84198419

84208420
/** Test case for
@@ -8463,7 +8463,7 @@ private void checkLiteral2(String expression, String expected) {
84638463
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withPostgresql().ok(expectedPostgres);
84648464
sql(query).withLibrary(SqlLibrary.SNOWFLAKE).withSnowflake().ok(expectedSnowflake);
84658465
sql(query).withLibrary(SqlLibrary.SPARK).withSpark().ok(expectedSpark);
8466-
sql(query).withLibrary(SqlLibrary.SPARK).withClickHouse().ok(expectedClickHouse);
8466+
sql(query).withLibrary(SqlLibrary.CLICKHOUSE).withClickHouse().ok(expectedClickHouse);
84678467
}
84688468

84698469
/** Test case for

0 commit comments

Comments
 (0)