You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Pengcheng Xiong <px...@apache.org> on 2016/02/02 08:14:58 UTC

About Calcite-1058

Hi all,

  Calcite-1058 made RelBuilder.filter(false) and RelBuilder.limit(0, 0)
simplify to empty(), i.e., empty logical values. However, Hive ASTConverter
is not able to deal with empty logical values. I saw it was resolved in
Calcite 1.6 but it was not included in the 1.6 snapshot when we tested
against Hive. I would assume that replacing RelBuilder class with a newly
created HiveRelBuilder would be expensive. Could you please let me know if
you have any better ideas? Thanks!

Best
Pengcheng

Re: About Calcite-1058

Posted by Julian Hyde <jh...@apache.org>.
A slight correction - in https://issues.apache.org/jira/browse/CALCITE-1058 (before 1.6) I only optimized LIMIT 0; I didn’t optimize WHERE FALSE until https://issues.apache.org/jira/browse/CALCITE-1056 (after 1.6).

I pushed 1056 (and also https://issues.apache.org/jira/browse/CALCITE-1059) to after release 1.6 because I knew you had run the Hive QA against Calcite’s RC already, and was trying to avoid screwing up Hive. I didn’t know 1058 would break Hive also. Sorry about that.

I don’t think it would be expensive to use HiveRelBuilder instead of RelBuilder. Instantiate Hive rules using a factory that creates HiveRelBuilder (the built-in rules use RelBuilder.proto, which creates a factory that creates a RelBuilder).

Or, probably simpler, continue to create a RelBuilder, but change its valuesFactory to do something different if there are 0 rows. You probably already have a HiveValuesFactory and are passing it into your RelBuilderFactory.

Julian
 

> On Feb 1, 2016, at 11:14 PM, Pengcheng Xiong <px...@apache.org> wrote:
> 
> Hi all,
> 
>  Calcite-1058 made RelBuilder.filter(false) and RelBuilder.limit(0, 0)
> simplify to empty(), i.e., empty logical values. However, Hive ASTConverter
> is not able to deal with empty logical values. I saw it was resolved in
> Calcite 1.6 but it was not included in the 1.6 snapshot when we tested
> against Hive. I would assume that replacing RelBuilder class with a newly
> created HiveRelBuilder would be expensive. Could you please let me know if
> you have any better ideas? Thanks!
> 
> Best
> Pengcheng