[
https://issues.apache.org/jira/browse/CALCITE-5694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720721#comment-17720721
]
Oliver Lee commented on CALCITE-5694:
-------------------------------------
Looks like the serialization is actually implemented already in
[https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonReader.java#L320]
Looking to find a way to share this code into RelJson.toRex() ...
> RelJson fails to serialize/deserialize AggregateCall
> ----------------------------------------------------
>
> Key: CALCITE-5694
> URL: https://issues.apache.org/jira/browse/CALCITE-5694
> Project: Calcite
> Issue Type: Bug
> Reporter: Oliver Lee
> Assignee: Oliver Lee
> Priority: Minor
>
> The current output of {{RelJson.toJson(AggregateCall call)}} will fail to
> serialize back into an {{{}AggregateCall{}}}.
> and throw {{java.lang.UnsupportedOperationException: cannot convert to rex}}
> Correct behavior:
> {quote}AggregateCall aggCall;
> Object jsonRepresentation = relJson.toJson(aggCall);
> assertThat(jsonRepresentation, notNullValue());
> RexNode deserialized = relJson.toRex(b.getCluster(), jsonRepresentation);
> assertThat(aggCall, is(deserialized));
> assertThat(jsonRepresentation, is(relJson.toJson(deserialized)));
> {quote}
>
> These 2 assert statements should evaluate to {{{}true{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)