You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by ho...@apache.org on 2019/05/17 03:25:44 UTC
[calcite] branch master updated: [CALCITE-3074] Move MySQL's JSON
operators to SqlLibraryOperators
This is an automated email from the ASF dual-hosted git repository.
hongze pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/master by this push:
new ca92ce2 [CALCITE-3074] Move MySQL's JSON operators to SqlLibraryOperators
ca92ce2 is described below
commit ca92ce27ce9f9a40d755a165041d64538a467a10
Author: Hongze Zhang <ho...@apache.org>
AuthorDate: Thu May 16 22:52:58 2019 +0800
[CALCITE-3074] Move MySQL's JSON operators to SqlLibraryOperators
---
.../calcite/adapter/enumerable/RexImpTable.java | 2 +-
.../calcite/sql/fun/SqlLibraryOperators.java | 13 +++++----
.../calcite/sql/fun/SqlStdOperatorTable.java | 31 +++++++++++++---------
3 files changed, 27 insertions(+), 19 deletions(-)
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 c5237ee..f1fe432 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_DEPTH;
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_EXISTS;
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 9a536e3..c48387a 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 @@ public abstract class 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 2c6fe37..9f97d71 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 class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
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 class SqlStdOperatorTable extends ReflectiveSqlOperatorTable {
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);