trafodion-codereview mailing list archives

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

    https://github.com/apache/incubator-trafodion/pull/66#discussion_r38109219
  
    --- 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 --
    
    OK. I'll take that comment out in next check-in.  Thanks
    
    On Thu, Aug 27, 2015 at 10:25 AM, DaveBirdsall <notifications@github.com>
    wrote:
    
    > In core/sql/optimizer/SearchKey.cpp
    > <https://github.com/apache/incubator-trafodion/pull/66#discussion_r38108486>
    > :
    >
    > > +  // 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.
    >
    > 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?
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/incubator-trafodion/pull/66/files#r38108486>.
    >
    
    
    
    -- 
    Regards, --Qifan



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