diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java index c5237ee80414..f1fe432c173b 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java @@ -95,6 +95,7 @@ import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_KEYS; import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_LENGTH; import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_PRETTY; +import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_REMOVE; import static org.apache.calcite.sql.fun.SqlLibraryOperators.JSON_TYPE; import static org.apache.calcite.sql.fun.SqlLibraryOperators.TRANSLATE3; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.ABS; @@ -172,7 +173,6 @@ import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_OBJECT; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_OBJECTAGG; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_QUERY; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_REMOVE; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_VALUE_ANY; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.JSON_VALUE_EXPRESSION; import static org.apache.calcite.sql.fun.SqlStdOperatorTable.LAG; 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 9a536e3c0303..c48387a05c0d 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 @@ -133,19 +133,22 @@ private SqlLibraryOperators() { public static final SqlFunction TRANSLATE3 = new SqlTranslate3Function(); @LibraryOperator(libraries = {MYSQL}) - public static final SqlFunction JSON_TYPE = SqlStdOperatorTable.JSON_TYPE; + public static final SqlFunction JSON_TYPE = new SqlJsonTypeFunction(); @LibraryOperator(libraries = {MYSQL}) - public static final SqlFunction JSON_DEPTH = SqlStdOperatorTable.JSON_DEPTH; + public static final SqlFunction JSON_DEPTH = new SqlJsonDepthFunction(); @LibraryOperator(libraries = {MYSQL}) - public static final SqlFunction JSON_LENGTH = SqlStdOperatorTable.JSON_LENGTH; + public static final SqlFunction JSON_LENGTH = new SqlJsonLengthFunction(); @LibraryOperator(libraries = {MYSQL}) - public static final SqlFunction JSON_KEYS = SqlStdOperatorTable.JSON_KEYS; + public static final SqlFunction JSON_KEYS = new SqlJsonKeysFunction(); @LibraryOperator(libraries = {MYSQL}) - public static final SqlFunction JSON_PRETTY = SqlStdOperatorTable.JSON_PRETTY; + public static final SqlFunction JSON_PRETTY = new SqlJsonPrettyFunction(); + + @LibraryOperator(libraries = {MYSQL}) + public static final SqlFunction JSON_REMOVE = new SqlJsonRemoveFunction(); } // End SqlLibraryOperators.java diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java index 2c6fe3750858..9f97d71b2db2 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java @@ -1299,11 +1299,6 @@ public boolean argumentMustBeScalar(int ordinal) { public static final SqlFunction JSON_VALUE = new SqlJsonValueFunction("JSON_VALUE", false); - public static final SqlFunction JSON_KEYS = new SqlJsonKeysFunction(); - - public static final SqlFunction JSON_PRETTY = - new SqlJsonPrettyFunction(); - public static final SqlFunction JSON_VALUE_ANY = new SqlJsonValueFunction("JSON_VALUE_ANY", true); @@ -1311,20 +1306,30 @@ public boolean argumentMustBeScalar(int ordinal) { public static final SqlFunction JSON_OBJECT = new SqlJsonObjectFunction(); - public static final SqlFunction JSON_TYPE = new SqlJsonTypeFunction(); - - public static final SqlFunction JSON_DEPTH = new SqlJsonDepthFunction(); - - public static final SqlFunction JSON_LENGTH = new SqlJsonLengthFunction(); - - public static final SqlFunction JSON_REMOVE = new SqlJsonRemoveFunction(); - public static final SqlJsonObjectAggAggFunction JSON_OBJECTAGG = new SqlJsonObjectAggAggFunction(SqlKind.JSON_OBJECTAGG, SqlJsonConstructorNullClause.NULL_ON_NULL); public static final SqlFunction JSON_ARRAY = new SqlJsonArrayFunction(); + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_TYPE = SqlLibraryOperators.JSON_TYPE; + + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_DEPTH = SqlLibraryOperators.JSON_DEPTH; + + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_LENGTH = SqlLibraryOperators.JSON_LENGTH; + + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_KEYS = SqlLibraryOperators.JSON_KEYS; + + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_PRETTY = SqlLibraryOperators.JSON_PRETTY; + + @Deprecated // to be removed before 2.0 + public static final SqlFunction JSON_REMOVE = SqlLibraryOperators.JSON_REMOVE; + public static final SqlJsonArrayAggAggFunction JSON_ARRAYAGG = new SqlJsonArrayAggAggFunction(SqlKind.JSON_ARRAYAGG, SqlJsonConstructorNullClause.ABSENT_ON_NULL);