[ 
https://issues.apache.org/jira/browse/CALCITE-3583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17418385#comment-17418385
 ] 

xzh_dz edited comment on CALCITE-3583 at 9/22/21, 2:41 AM:
-----------------------------------------------------------

[~julianhyde]

thanks for review.

There is already a PR that supports `RelDistribution` serialization and 
deserialization.but when I tested the unit test `{{testExchange`}}, I got the 
message below.

`

java.lang.NullPointerException: no entry for tag collation
 java.lang.RuntimeException: java.lang.NullPointerException: no entry for tag 
collation
 at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:193)
 at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:135)

`

So i create a new JIRA. Maybe this JIRA should be closed.

Please help review [Exchange operator deserialize 
fail|https://github.com/apache/calcite/pull/2519]


was (Author: xzh_dz):
[~julianhyde]

thanks for review.

There is already a PR that supports `RelDistribution` serialization and 
deserialization.but when I tested the unit test `{{testExchange`}}, I got the 
message below.

`

java.lang.NullPointerException: no entry for tag collation
java.lang.RuntimeException: java.lang.NullPointerException: no entry for tag 
collation
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:193)
at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:135)

`

So i create a new JIRA. Maybe this JIRA should be closed.

Please help review [Exchange operator deserialize 
fail|[http://example.com|https://github.com/apache/calcite/pull/2519]]

> Support serialized to json and deserialized from json for Exchange relation 
> operator
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3583
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3583
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Wang Yanlin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Currently, serialize Exchange relnode to json  will cause exception
> {code:java}
> // 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));
>   }
> {code}
> got
> {code:java}
> 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)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to