You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/02/02 19:03:00 UTC
[jira] [Commented] (CALCITE-4996) [RelJson] create a new public toRex method which can override makeInputRef
[ https://issues.apache.org/jira/browse/CALCITE-4996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486035#comment-17486035 ]
Julian Hyde commented on CALCITE-4996:
--------------------------------------
Can you replace the triple-backticks with brace-code-brace? Jira uses different formatting than GitHub issues. (FYI there's also brace-noformat-brace if you want pre-formatted typewriter font.)
Can you add a test case to the PR? Most tests for {{RelJson}} are in {{RelOptPlanReaderTest}}.
> [RelJson] create a new public toRex method which can override makeInputRef
> --------------------------------------------------------------------------
>
> Key: CALCITE-4996
> URL: https://issues.apache.org/jira/browse/CALCITE-4996
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Marieke Gueye
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> In the case of our project, the environment that generates a JSON from a RexNode and the environment that reads it are different. We need to "translate" the inputs into their aliases in the new cluster.
> This method will permit to give more freedom to the JSON RexNode parser if needed.
> ```
> /**
> * Transforms a RexNode tree defined in a map (from a JSON) into a RexNode
> * @param cluster: The optimization Environment
> * @param o the map derived from a RexNode transformed into a JSON
> * @param InputMapToRex is a BiFunction that transform the map representing input references into RexNode.
> * it has two parameters: the map of the references and the RexBuilder
> * @return the RexNode
> */
> public RexNode toRex(RelOptCluster cluster, Object o, BiFunction<Map, RexBuilder, RexNode> InputMapToRex)
> ```
> Make sure that `RexNode toRex(RelInput relInput, @PolyNull Object o) ` is still working
--
This message was sent by Atlassian Jira
(v8.20.1#820001)