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 2015/06/10 00:26:01 UTC

[jira] [Resolved] (CALCITE-748) Builder for relational expressions

     [ https://issues.apache.org/jira/browse/CALCITE-748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-748.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.4.0-incubating

Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/6609cb1a.

> Builder for relational expressions
> ----------------------------------
>
>                 Key: CALCITE-748
>                 URL: https://issues.apache.org/jira/browse/CALCITE-748
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>             Fix For: 1.4.0-incubating
>
>
> Creating relational expressions currently involves calling the "create" method of the relevant sub-class of RelNode, often with a lot of obscure parameters. This might be appropriate for someone writing a rule, but is not particularly friendly to someone who wants to write queries using an API.
> We propose instead a builder. It would have a method for each core type of relational expression; for example a {{filter}} method that returns a Filter. For a given type, there might be overloads that allow you more control.
> Inside the builder is a factory for each operator type. Thus a builder could be configured to create logical rels (LogicalFilter, LogicalProject) or rels of a different convention (HiveFilter, HiveProject).
> Two particular areas that the builder can help. First, it can deduce the names and types of output columns. (You can override types, and optionally also names, or maybe just some names, using other APIs.)
> Second, it can help you build RexNode expressions. It knows the type and names of the input, it will let you build expressions in terms of column ordinals or names, which are easier than RexInputRefs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)