You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2019/10/30 17:58:00 UTC

[jira] [Commented] (CALCITE-3462) Add method in RelBuilder for conveniently projecting out expressions

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

Julian Hyde commented on CALCITE-3462:
--------------------------------------

* FWIW, I added {{RelBuilder.projectPlus}} but I'm not sure it's a huge success – it's not used anywhere our code base. (Of course, other people might be finding it useful.)
 * Do you think that your proposed {{projectMinus}} operation would be more natural as an operation on fields, e.g. {{fieldsExcept(RexNode...)}}, so {{b.scan("t").project(b.fields("a", ""b", "c")).project(b.fieldsExcept(b.field("b"))}} would return {{["a", "b"]}}. The same could be said for {{projectPlus}}, of course. I am torn on this; I'd like to hear what you think.
 * I think the method should fail if it fails to find any of the given expressions, or if the list of expressions contains duplicates (i.e. tries to remove the same expression twice). Its argument should be a collection, not a list.
 * I think {{projectExcept}} is a slightly better name. "minus" makes me think of the relational operation.
 * Test it with a variety of expressions - fields by ordinal, by alias, and by table name and alias.
 * Add the method name to the case description and remove "conveniently".

> 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: 10m
>  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)