quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbdeshmukh <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #217: QUICKSTEP-73: Multi-attribute Partiti...
Date Fri, 24 Mar 2017 16:55:30 GMT
Github user hbdeshmukh commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/217#discussion_r107950590
  
    --- 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 --
    
    Do you mean to use ``continue`` here? The break will cause the control to come out of
the for loop and we wouldn't have compared all the attributes, subsequently returning true.
Am I missing something? 


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