calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: SqlSpecialOperator.createCall method is overridden only for some nodes
Date Tue, 07 Feb 2017 00:10:23 GMT
SqlOperator.createCall seems to be called mainly from SqlNode.clone, and that only tends to
be called for expressions.

Ideally SqlInsert should have a createCall method but it’s not high priority unless it is
causing incorrect behavior. Likewise SqlMerge, SqlUpdate, SqlDelete.

SqlCreate, SqlDrop, SqlAlter are abstract and do not even have their own operators so it’s
not possible to fix them.

Julian


> On Feb 2, 2017, at 8:09 AM, Arina Yelchiyeva <arina.yelchiyeva@gmail.com> wrote:
> 
> Hi all,
> 
> I have noticed that for example, for SqlExplain
> SqlSpecialOperator.createCall [1] method is overridden but for SqlInsert
> [2] it is not. Thus in case with SqlExplain OPERATOR createCall returns
> SqlCall instance that can be cast to SqlExplain but in case of SqlInsert
> createCall returns SqlCall that can be cast only to SqlBasicCall (and I
> can't take advantage of SqlInsert methods).
> 
> So I wanted to ask is there is any particular reason why some nodes do have
> createCall method overridden and some don't? And in case of SqlInsert
> should it be fixed or not?
> 
> [1]
> https://github.com/apache/calcite/blob/92b3d381de4c0f6670cff06d54ce06b8231e6684/core/src/main/java/org/apache/calcite/sql/SqlExplain.java#L31
> [2]
> https://github.com/apache/calcite/blob/02752fe78f817ed317b8873d2f4c7b79bfe8b9b5/core/src/main/java/org/apache/calcite/sql/SqlInsert.java#L31
> 
> Kind regards
> Arina


Mime
View raw message