calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus Camacho Rodriguez (JIRA)" <>
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
             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:

  HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER))
will be transformed into:
HiveProject(robot=$0,_o__c1=$2,m=$3,s=$4,(tok_function tok_int (tok_table_or_col robot))=CAST($0):INTEGER))
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

View raw message