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

Stamatis Zampetakis commented on CALCITE-6869:
----------------------------------------------

It seems a bit arbitrary to add a comment in the javadoc of a single rule when 
there are many places in the code where we create project operators and thus 
there is the likelihood of losing aliases. If we want to improve the 
documentation we should rather do it at 
https://calcite.apache.org/docs/algebra.html but as far as I see there are 
already some mentions about it.

{noformat}
But if a relational expression has passed through several rewrite rules (see 
RelOptRule), the field names of the resulting expression might not look much 
like the originals. At that point it is better to reference fields by ordinal.
{noformat}

If we need improvements I believe the best place to do them is there and not 
start touching every rule that handles projections.


> Add instructions for the alias loss problem in ProjectRemoveRule
> ----------------------------------------------------------------
>
>                 Key: CALCITE-6869
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6869
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Zhen Chen
>            Assignee: Zhen Chen
>            Priority: Minor
>              Labels: pull-request-available
>
> We should add a description of the alias loss problem and the current calcite 
> solution in ProjectRemoveRule to avoid this issue being raised again.



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

Reply via email to