Github user nonstop-qfchen commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/132#discussion_r42409339
  
    --- Diff: core/sql/optimizer/PartFunc.cpp ---
    @@ -5009,6 +5020,118 @@ void RangePartitioningFunction::print(FILE* ofd, 
const char* indent,
       partitionBoundaries_->print(ofd, indent, title);
     
     } // RangePartitioningFunction::print()
    +
    +
    +NABoolean 
    +compareEncodedKey(const char* low, const char* key, const char* high, 
Int32 keyLen, NABoolean checkLast)
    +{
    +    Int32 cmpLow = memcmp(low, key, keyLen);
    +    Int32 cmpHigh = memcmp(key, high, keyLen);
    +
    +    if ( cmpLow <= 0 && cmpHigh < 0 )
    +       return TRUE;
    +
    +    return (checkLast && cmpLow <= 0 && cmpHigh <= 0);
    +}
    +
    +NABoolean 
    +compareAsciiKey(const char* low, const char* key, const char* high, Int32, 
NABoolean checkLast)
    +{
    +    Int32 cmpLow = strverscmp(low, key);
    +    Int32 cmpHigh = strverscmp(key, high);
    +
    +    if ( cmpLow <= 0 && cmpHigh < 0 )
    +       return TRUE;
    +
    +    return (checkLast && cmpLow <= 0 && cmpHigh <= 0);
    +}
    +
    +
    +// find a boundary pair [low, high) with smallest low value in which keys 
fall, and return the
    --- End diff --
    
    I'll address it.
    
    On Mon, Oct 19, 2015 at 1:26 PM, DaveBirdsall <[email protected]>
    wrote:
    
    > In core/sql/optimizer/PartFunc.cpp
    > 
<https://github.com/apache/incubator-trafodion/pull/132#discussion_r42407695>
    > :
    >
    > > +}
    > > +
    > > +NABoolean
    > > +compareAsciiKey(const char* low, const char* key, const char* high, 
Int32, NABoolean checkLast)
    > > +{
    > > +    Int32 cmpLow = strverscmp(low, key);
    > > +    Int32 cmpHigh = strverscmp(key, high);
    > > +
    > > +    if ( cmpLow <= 0 && cmpHigh < 0 )
    > > +       return TRUE;
    > > +
    > > +    return (checkLast && cmpLow <= 0 && cmpHigh <= 0);
    > > +}
    > > +
    > > +
    > > +// find a boundary pair [low, high) with smallest low value in which 
keys fall, and return the
    >
    > findBeginBoundary starts its search at the end of the partition array,
    > while findEndBoundary starts its search at the beginning. I would have
    > thought we would have done the opposite. A full scan would cause us to
    > search the entire array twice. Though I suppose once we get to 100's of
    > partitions, we'll want to change both of these to binary searches.
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/incubator-trafodion/pull/132/files#r42407695>.
    >
    
    
    
    -- 
    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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to