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

Stamatis Zampetakis commented on CALCITE-3462:
----------------------------------------------

Thanks for the feedback [~julianhyde]. Answers below:
* There were various places in our code-base where people reproduced the 
behavior of {{RelBuilder.projectPlus}} usually in a more complicated and less 
readable manner; having this method allowed me to simplify the code in these 
places.
* Truth is that in all the use-cases we have minus or plus remains an operation 
on fields; for the sake of the discussion minus in most cases is used to obtain 
all the fields of a table except the system/technical fields.
* In terms of convenience, I think would be better to just leave the fields as 
they are if an expression is not found. There are various parts in the builder 
where we are performing simplifications so from one perspective leaving the 
expressions as is can be considered a simplification. For instance adding 
duplicate predicates in a filter will not fail, it will just simplify the 
filter.
* I would say that the argument is neither a collection nor a list but rather 
an iterable as the other similar methods.
* Both {{projectExcept}} or {{fieldsExcept}} sound good to me let me know which 
you prefer. If we keep {{projectPlus}} then for API regularity I would go for 
{{projectExcept}}.
* I will add more tests.
* I will change the description as soon as we agree on the name; let me know 
which one you prefer.

> Add method in RelBuilder for conveniently projecting out expressions
> --------------------------------------------------------------------
>
>                 Key: CALCITE-3462
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3462
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.21.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.22.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Add a new method in RelBuilder (i.e., {{RelBuilder.projectMinus}}) to 
> facilitate the task of projecting out certain expressions from the top of the 
> plan. 
> The proposed method is purely for convenience and is the dual of the existing 
> {{RelBuilder.projectPlus}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to