calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mm...@apache.org
Subject calcite git commit: [CALCITE-1696] Support LOCAL_REF for EXPLAIN PLAN AS JSON
Date Tue, 14 Mar 2017 17:56:25 GMT
Repository: calcite
Updated Branches:
  refs/heads/master cdc1d960a -> 9f23e1a0d


[CALCITE-1696] Support LOCAL_REF for EXPLAIN PLAN AS JSON


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/9f23e1a0
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/9f23e1a0
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/9f23e1a0

Branch: refs/heads/master
Commit: 9f23e1a0d6a4ed10d938b7f5eaa8c2c0314a029b
Parents: cdc1d96
Author: Michael Mior <mmior@uwaterloo.ca>
Authored: Tue Mar 14 13:42:24 2017 -0400
Committer: Michael Mior <mmior@uwaterloo.ca>
Committed: Tue Mar 14 13:56:21 2017 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/calcite/rel/externalize/RelJson.java  | 6 ++++--
 core/src/test/java/org/apache/calcite/plan/RelWriterTest.java  | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/9f23e1a0/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
index 0fb3f73..f4a1f21 100644
--- a/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
+++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
@@ -35,9 +35,9 @@ import org.apache.calcite.rex.RexBuilder;
 import org.apache.calcite.rex.RexCall;
 import org.apache.calcite.rex.RexCorrelVariable;
 import org.apache.calcite.rex.RexFieldAccess;
-import org.apache.calcite.rex.RexInputRef;
 import org.apache.calcite.rex.RexLiteral;
 import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexSlot;
 import org.apache.calcite.sql.SqlAggFunction;
 import org.apache.calcite.sql.SqlFunction;
 import org.apache.calcite.sql.SqlOperator;
@@ -316,8 +316,10 @@ public class RelJson {
       }
       return value2;
     case INPUT_REF:
+    case LOCAL_REF:
       map = jsonBuilder.map();
-      map.put("input", ((RexInputRef) node).getIndex());
+      map.put("input", ((RexSlot) node).getIndex());
+      map.put("name", ((RexSlot) node).getName());
       return map;
     case CORREL_VARIABLE:
       map = jsonBuilder.map();

http://git-wip-us.apache.org/repos/asf/calcite/blob/9f23e1a0/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java b/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
index b7a0bd2..5869024 100644
--- a/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
+++ b/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java
@@ -69,7 +69,8 @@ public class RelWriterTest {
       + "        \"op\": \"=\",\n"
       + "        \"operands\": [\n"
       + "          {\n"
-      + "            \"input\": 1\n"
+      + "            \"input\": 1,\n"
+      + "            \"name\": \"$1\"\n"
       + "          },\n"
       + "          10\n"
       + "        ]\n"


Mime
View raw message