You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "TJ Banghart (Jira)" <ji...@apache.org> on 2023/03/31 17:56:00 UTC
[jira] [Comment Edited] (CALCITE-5625) Expand SEARCH RexNode when converting toJson
[ https://issues.apache.org/jira/browse/CALCITE-5625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17707374#comment-17707374 ]
TJ Banghart edited comment on CALCITE-5625 at 3/31/23 5:55 PM:
---------------------------------------------------------------
Hey [~julianhyde] thanks for taking a look!
When attempting to serialize/deserialize {{SEARCH}} the main blocker appears to be [Guava's {{RangeSet}}|https://guava.dev/releases/23.0/api/docs/com/google/common/collect/RangeSet.html] that are used in {{Sarg}} operands.
Specifically, handling the deserialization of the {{Comparables that the {{Range}}}} could be composed of proved challenging. I believe there is a way to do this correctly and we should see what the best way to handle those arguments would be.
An alternative to {{SEARCH}} serialization could be adding the following case in [{{toJson(RexNode)}} |https://github.com/apache/calcite/blob/a10b858664250f9005e32857e57a18b8c48ec931/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java#L552] which expands the {{SEARCH}} in a way that allows for (de)serialization.
{code:java}
case SEARCH:
if (!CALCITE_5614_FIXED) {
return toJson(RexUtil.expandSearch(new RexBuilder(new JavaTypeFactoryImpl()), null, node));
}
{code}
was (Author: tjbanghart):
Hey [~julianhyde] thanks for taking a look!
When attempting to serialize/deserialize {{SEARCH}} the main blocker appears to be [Guava's {{RangeSet}}|https://guava.dev/releases/23.0/api/docs/com/google/common/collect/RangeSet.html] that are used in {{Sarg}} operands.
Specifically, handling the deserialization the {{Comparable}}s that the {{Range}} could be composed of proved challenging. I believe there is a way to do this correctly and we should see what the best way to handle those arguments would be.
An alternative to {{SEARCH}} serialization could be adding the following case in [{{toJson(RexNode)}} |https://github.com/apache/calcite/blob/a10b858664250f9005e32857e57a18b8c48ec931/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java#L552] which expands the {{SEARCH}} in a way that allows for (de)serialization.
{code:java}
case SEARCH:
if (!CALCITE_5614_FIXED) {
return toJson(RexUtil.expandSearch(new RexBuilder(new JavaTypeFactoryImpl()), null, node));
}
{code}
> Expand SEARCH RexNode when converting toJson
> ---------------------------------------------
>
> Key: CALCITE-5625
> URL: https://issues.apache.org/jira/browse/CALCITE-5625
> Project: Calcite
> Issue Type: Sub-task
> Reporter: Oliver Lee
> Priority: Major
>
> Because the Sarg class is not able to be serialized/deserialized to/from JSON, we would like to expand the SEARCH RexNode as a workaround.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)