[
https://issues.apache.org/jira/browse/CALCITE-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16671284#comment-16671284
]
Stamatis Zampetakis commented on CALCITE-2649:
----------------------------------------------
I don't want to know the stack depth and I don't want to specify the inputCount
when I am creating field references with aliases.
I am just building conditions before/after joins so as you correctly guessed I
am calling RelBuilder#field(inputCount,alias,fieldName) method with either
inputCount=1 or inputCount=2. However, in order to pass the correct inputCount
I need to know if the join is performed or not. Furthermore, to use inputCount
correctly I need to be aware of the internals of the RelBuilder like for
example that when the join is applied the stack size decreases.
I think that it would be convenient to just call
RelBuilder#field(alias,fieldName) in every case instead of
RelBuilder#field(inputCount,alias,fieldName). Assuming that
RelBuilder#field(alias,fieldName) is able to search anywhere in the stack, I
don't see a huge benefit of having RelBuilder#field(inputCount,alias,fieldName)
as part of the public API but maybe there is a good reason for its existence.
> Allow RelBuilder to create field references to aliased relations without
> knowing the size of the stack
> ------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-2649
> URL: https://issues.apache.org/jira/browse/CALCITE-2649
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.17.0
> Reporter: Stamatis Zampetakis
> Assignee: Julian Hyde
> Priority: Minor
> Labels: beginner, newbie
> Fix For: 1.18.0
>
>
> As of [CALCITE-1523|https://issues.apache.org/jira/browse/CALCITE-1523] it is
> possible to create field references to aliased relations anywhere in the
> stack. However the respective field method requires to pass as a parameter
> the inputCount (i.e., size of the stack). This is not very convenient since
> clients of RelBuilder are obliged to track the size of the stack (leading to
> the uneseccary creation of Wrapper classes).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)