calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus Camacho Rodriguez (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CALCITE-1618) SortProjectTransposeRule ignores CAST in the Project operator
Date Fri, 03 Feb 2017 13:38:51 GMT
Jesus Camacho Rodriguez created CALCITE-1618:
------------------------------------------------

             Summary: SortProjectTransposeRule ignores CAST in the Project operator
                 Key: CALCITE-1618
                 URL: https://issues.apache.org/jira/browse/CALCITE-1618
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.11.0
            Reporter: Jesus Camacho Rodriguez
            Assignee: Jesus Camacho Rodriguez
             Fix For: 1.12.0


For instance:

{noformat}
...
HiveSortLimit(sort0=$4,sort1=$2,dir0=ASC-nulls-first,dir1=DESC-nulls-last,fetch=10)
  HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER))
...
{noformat}
will be transformed into:
{noformat}
...
HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER))
  HiveSortLimit(sort0=$0,sort1=$2,dir0=ASC-nulls-first,dir1=DESC-nulls-last,fetch=10)
...
{noformat}
which is incorrect.

The problem seems to be in the _permutation_ method in RelOptUtil, which is called in L87.
The method actually considers a CAST on a reference as a valid column permutation of the column
referenced; probably it should not.

_permutation_ is only called by this rule and UnionPullUpConstantsRule, thus it seems it is
safe to fix the semantics of the method.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message