Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Currently, serialize Exchange relnode to json will cause exception
// RelWriterTest @Test public void testExchange() { final FrameworkConfig config = RelBuilderTest.config().build(); final RelBuilder builder = RelBuilder.create(config); final RelNode rel = builder .scan("EMP") .exchange(RelDistributions.hash(ImmutableList.of(0, 1))) .build(); String relJson = RelOptUtil.dumpPlan("", rel, SqlExplainFormat.JSON, SqlExplainLevel.EXPPLAN_ATTRIBUTES); String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson); final String expected = "" + "LogicalExchange(distribution=[hash[0, 1]])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(s, isLinux(expected)); }
got
java.lang.UnsupportedOperationException: type not serializable: hash[0, 1] (type org.apache.calcite.rel.RelDistributions.RelDistributionImpl) at org.apache.calcite.rel.externalize.RelJson.toJson(RelJson.java:290) at org.apache.calcite.rel.externalize.RelJsonWriter.put(RelJsonWriter.java:83) at org.apache.calcite.rel.externalize.RelJsonWriter.explain_(RelJsonWriter.java:66) at org.apache.calcite.rel.externalize.RelJsonWriter.done(RelJsonWriter.java:128) at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:299) at org.apache.calcite.plan.RelOptUtil.dumpPlan(RelOptUtil.java:1981) at org.apache.calcite.plan.RelWriterTest.testExchange(RelWriterTest.java:772)
Attachments
Issue Links
- relates to
-
CALCITE-105 Externalize RelNode to and from JSON
- Closed
- links to