You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Renaud Delbru <re...@siren.solutions> on 2017/07/06 14:53:48 UTC

Best approach to attach metadata to a RelNode

Hi,

When creating a logical tree from our parse tree, we would like to be able
to attach metadata information to the logical rel node. For example, a user
could specify a particular algo to use for a join (e.g., hash join, merge
join, etc.), and we would need to attach this information to the
LogicalJoin node in order to have access to it when creating the physical
tree. What would be the correct approach to do that ? Are there examples
available somewhere that we can look at for inspiration ?

Thanks
Kind Regards

-- 
*Renaud Delbru*   Siren Solutions - CTO
T +353 91704885 |
renaud@siren.solutions | http://siren.solutions/
Unit 13 GTC, Mervue Park, Galway, Ireland

Re: Best approach to attach metadata to a RelNode

Posted by Renaud Delbru <re...@siren.solutions>.
Thanks Julian,

yes we would need just (2). We could try to contribute by providing a patch
for (2) if that is of interest. Maybe we could split the issue CALCITE-482
in three sub-issues ?

Also, given that we would have to wait for a new release of Calcite that
includes this patch, would it be possible on our side to implement this as
a custom metadata instead of a BuiltInMetadata ? I have tried to find an
example of such a custom metadata extension, but haven't found anything.


On Thu, Jul 6, 2017 at 7:33 PM, Julian Hyde <jh...@apache.org> wrote:

> I think you’re talking about SQL hints. It’s a feature that has been
> talked about several times but has never been implemented. See
> https://issues.apache.org/jira/browse/CALCITE-482 <
> https://issues.apache.org/jira/browse/CALCITE-482>.
>
> The full feature would require (1) extension to the parser to read hints,
> (2) a way of annotating RelNodes with hints, (3) changes to
> SqlToRelConverter propagate hints from the parse tree to the RelNode tree,
> but I think you need just (2). I’ll add some remarks on the JIRA case, and
> let’s discuss further there.
>
> Julian
>
>
>
> > On Jul 6, 2017, at 7:53 AM, Renaud Delbru <re...@siren.solutions>
> wrote:
> >
> > Hi,
> >
> > When creating a logical tree from our parse tree, we would like to be
> able
> > to attach metadata information to the logical rel node. For example, a
> user
> > could specify a particular algo to use for a join (e.g., hash join, merge
> > join, etc.), and we would need to attach this information to the
> > LogicalJoin node in order to have access to it when creating the physical
> > tree. What would be the correct approach to do that ? Are there examples
> > available somewhere that we can look at for inspiration ?
> >
> > Thanks
> > Kind Regards
> >
> > --
> > *Renaud Delbru*   Siren Solutions - CTO
> > T +353 91704885 |
> > renaud@siren.solutions | http://siren.solutions/
> > Unit 13 GTC, Mervue Park, Galway, Ireland
>
>


-- 
*Renaud Delbru*   Siren Solutions - CTO
T +353 91704885 |
renaud@siren.solutions | http://siren.solutions/
Unit 13 GTC, Mervue Park, Galway, Ireland

Re: Best approach to attach metadata to a RelNode

Posted by Julian Hyde <jh...@apache.org>.
I think you’re talking about SQL hints. It’s a feature that has been talked about several times but has never been implemented. See https://issues.apache.org/jira/browse/CALCITE-482 <https://issues.apache.org/jira/browse/CALCITE-482>.

The full feature would require (1) extension to the parser to read hints, (2) a way of annotating RelNodes with hints, (3) changes to SqlToRelConverter propagate hints from the parse tree to the RelNode tree, but I think you need just (2). I’ll add some remarks on the JIRA case, and let’s discuss further there.

Julian

 

> On Jul 6, 2017, at 7:53 AM, Renaud Delbru <re...@siren.solutions> wrote:
> 
> Hi,
> 
> When creating a logical tree from our parse tree, we would like to be able
> to attach metadata information to the logical rel node. For example, a user
> could specify a particular algo to use for a join (e.g., hash join, merge
> join, etc.), and we would need to attach this information to the
> LogicalJoin node in order to have access to it when creating the physical
> tree. What would be the correct approach to do that ? Are there examples
> available somewhere that we can look at for inspiration ?
> 
> Thanks
> Kind Regards
> 
> -- 
> *Renaud Delbru*   Siren Solutions - CTO
> T +353 91704885 |
> renaud@siren.solutions | http://siren.solutions/
> Unit 13 GTC, Mervue Park, Galway, Ireland