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:25:22 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/66#discussion_r38108486
  
    --- 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);
    +  }
    +
    +  // compute the # of leading key columns covered by the key columns 
    +  // in the disjunct.
    --- End diff --
    
    Not sure I understand this comment since I don't see a counter being incremented anywhere.
I do see the fullKeyPredicates_ member being populated. I'm guessing the intent is to get
the covered leading prefix of the key. The correctness of the code I'm guessing depends on
"predicates" being ordered by key position but "predicates" is a ValueIdSet, so does it have
an order?


---
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