[
https://issues.apache.org/jira/browse/CALCITE-4996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486644#comment-17486644
]
Julian Hyde commented on CALCITE-4996:
--------------------------------------
[~zabetak], I also have some concerns about how the method takes a Java
{{Map<String, Object>}} representing a JSON object, containing typically an
ordinal and perhaps some other fields. And therefore this method is doing some
'transformation'.
I think it would be purer if the method just took just an {{int ordinal}}. Then
it would be clearer that the method it to deserialize expressions whose input
fields do not necessarily come from the output of a {{RelNode}}.
[~mkou] and I are working through the refactoring process and we may or may not
get to that point.
> [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: 0.5h
> 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.
> {code}
> /**
> * Transforms a RexNode tree defined in a map (from a JSON) into a RexNode
> * Applying a special method to inputs instead of transforming them into
> inputRef
> * @param cluster The optimization environment
> * @param apply is a InputTranslator lambda that transforms the map
> representing input
> * references into a RexNode
> * @param o the map derived from a RexNode transformed into a JSON
> * @return the transformed RexNode
> */
> {code}
> Make sure that {{RexNode toRex(RelInput relInput, @PolyNull Object o)}} is
> still working + adding tests
--
This message was sent by Atlassian Jira
(v8.20.1#820001)