trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: fix #JIRA 1449: missing end key.
Date Thu, 27 Aug 2015 15:09:00 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/66#discussion_r38106441
  
    --- Diff: core/sql/optimizer/SearchKey.cpp ---
    @@ -2711,6 +2716,65 @@ void SearchKey::computeCoveredLeadingKeys()
       }
     }
     
    +void SearchKey::computeFullKeyPredicates(ValueIdSet& predicates)
    +{
    +  // If the key column is an INDEX COLUMN, convert it into a base column
    +  ValueIdList baseKeyCols;
    +
    +  ValueId vid;
    +  const ValueIdList& keyColumns = getKeyColumns();
    +  for (CollIndex i=0; i<keyColumns.entries(); i++ ) {
    +     if ( keyColumns[i].getItemExpr()->getOperatorType() == ITM_INDEXCOLUMN )
    +       vid = ((IndexColumn*)(keyColumns[i].getItemExpr()))->getDefinition();
    +     else
    +       vid = keyColumns[i];
    +
    +     baseKeyCols.insertAt(baseKeyCols.entries(), vid);
    +  }
    --- End diff --
    
    So this code works for index key columns and base table key columns (because if it is
a base table key column, we go to line 2730 and don't attempt any mapping).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message