Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/132#discussion_r42517288
--- 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 --
Wonder whether it would be worth doing a binary search.
---
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.
---