[
https://issues.apache.org/jira/browse/CALCITE-3875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17066959#comment-17066959
]
Justin Swett commented on CALCITE-3875:
---------------------------------------
Definitely more useful if it can be called from an IDE debug session!
> Create visitor to emit java code that would reproduce the visited rel
> ---------------------------------------------------------------------
>
> Key: CALCITE-3875
> URL: https://issues.apache.org/jira/browse/CALCITE-3875
> Project: Calcite
> Issue Type: New Feature
> Affects Versions: 1.22.0
> Reporter: Justin Swett
> Priority: Minor
>
> It would be nice to have a visitor that would emit java code that could be
> used to reproduce the visited rel node, e.g.
> Something like:
> {code:java}
> ...
> String javaCode = RelOptUtil.toCode( myComplicatedRel );
> println(javaCode);
> // outputs something
> final RelBuilder builder = relBuilder();
> final RelNode root = builder
> .scan("EMP")
> .aggregate(builder.groupKey(),
> builder.aggregateCall(SqlStdOperatorTable.SUM0, false, false,
> null,
> "s", builder.field(3)))
> .build();
> {code}
> This could be useful setting up reproducible test cases that are somewhat
> tricky to recreate in the wild.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)