Github user hbdeshmukh commented on a diff in the pull request: https://github.com/apache/incubator-quickstep/pull/217#discussion_r107954118 --- Diff: catalog/PartitionSchemeHeader.hpp --- @@ -288,22 +310,46 @@ class RangePartitionSchemeHeader : public PartitionSchemeHeader { * @brief Check if the partition range boundaries are in ascending order. **/ void checkPartitionRangeBoundaries() { + for (const PartitionValues &partition_range_boundary : partition_range_boundaries_) { + CHECK_EQ(partition_attribute_ids_.size(), partition_range_boundary.size()) + << "A partition boundary has different size than that of partition attributes."; + } + for (partition_id part_id = 1; part_id < partition_range_boundaries_.size(); ++part_id) { - if (less_unchecked_comparator_->compareTypedValues( - partition_range_boundaries_[part_id], - partition_range_boundaries_[part_id - 1])) { - LOG(FATAL) << "Partition boundaries are not in ascending order."; + CHECK(lessThan(partition_range_boundaries_[part_id - 1], partition_range_boundaries_[part_id])) + << "Partition boundaries are not in ascending order."; + } + } + + bool lessThan(const PartitionValues &lhs, const PartitionValues &rhs) const { + DCHECK_EQ(partition_attribute_ids_.size(), lhs.size()); + DCHECK_EQ(partition_attribute_ids_.size(), rhs.size()); + + for (std::size_t attr_index = 0; attr_index < partition_attribute_ids_.size(); ++attr_index) { + if (less_unchecked_comparators_[attr_index]->compareTypedValues(lhs[attr_index], rhs[attr_index])) { + break; --- End diff -- I think your matching definition is as follows: (x1, x2, x3, ..., xk) < (y1, y2, y3, ..., yk) if (x1 < x2) || (x2, x3, ..., xk) < (y2, y3, ... yk). If that's correct, this should be clearly stated somewhere in the code.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---