You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Oliver Lee (Jira)" <ji...@apache.org> on 2023/05/03 00:08:00 UTC

[jira] [Commented] (CALCITE-5614) Serialize Sarg objects to and from JSON

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

Oliver Lee commented on CALCITE-5614:
-------------------------------------

I spoke to [~julianhyde]  about my concerns for using `instanceof Map` instead of `Map.isAssignableFrom()`

I tested the behavior in Calcite and have a PR just for documentations sake (do not merge)

Summary: Seems like `gson` `LinkedTreeMap instanceof Map` does evaluate to `true`, so no need to update the commit 
[3326475c|https://github.com/apache/calcite/commit/3326475c766267d521330006cc80730c4e456191]

> Serialize Sarg objects to and from JSON
> ---------------------------------------
>
>                 Key: CALCITE-5614
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5614
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Oliver Lee
>            Assignee: Oliver Lee
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Context: Bounded filter conditions (e.g. {{{}SUM(field> > 1 AND SUM(field) < 10{}}}) are converted to calls to a [SEARCH operator.|https://github.com/apache/calcite/blob/052a5cc724a889edf19c1d76ea166c0d0924a5d3/core/src/main/java/org/apache/calcite/rex/RexInterpreter.java#L224calls] If this is then serialized and deserialized, it will throw an exception when resolving {{{}SEARCH{}}}.
>  
>  
> To complete this ticket: Add functionality such that {{Sarg}} literals can be serialized and deserialized.
>  
> {{RelJson.java}} should be updated so that {{toRex}} can serialize {{Sarg}} objects
>  
> {{RexBuilder.java}} should be updated to be able to successfully deserialize a JSON string that includes {{Sarg}} literals 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)