quickstep-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zuyu <...@git.apache.org>
Subject [GitHub] incubator-quickstep pull request #224: Fix a bug in PackedPayloadHashTable
Date Mon, 27 Mar 2017 21:26:12 GMT
Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/224#discussion_r108283380
  
    --- Diff: storage/PackedPayloadHashTable.cpp ---
    @@ -239,26 +239,47 @@ bool PackedPayloadHashTable::upsertValueAccessorCompositeKey(
     
       base_accessor->beginIterationVirtual();
       if (has_derived_accessor) {
    +    // NOTE(jianqiao): Currently we expect derived_accessor to be either
    +    // ColumnVectorsValueAccesor or
    +    // TupleIdSequenceAdapterValueAccessor<ColumnVectorsValueAccesor>
         DCHECK(derived_accessor->getImplementationType()
                    == ValueAccessor::Implementation::kColumnVectors);
    +    DCHECK(!derived_accessor->isOrderedTupleIdSequenceAdapter());
         derived_accessor->beginIterationVirtual();
       }
     
       return InvokeOnBools(
    -      has_derived_accessor,
           handles_.empty(),
           !all_keys_inline_,
    -      [&](auto use_two_accessors,  // NOLINT(build/c++11)
    -          auto key_only,
    +      [&](auto key_only,  // NOLINT(build/c++11)
               auto has_variable_size) -> bool {
    -    return this->upsertValueAccessorCompositeKeyInternal<
    -        decltype(use_two_accessors)::value,
    -        decltype(key_only)::value,
    -        decltype(has_variable_size)::value>(
    -            argument_ids,
    -            key_attr_ids,
    -            base_accessor,
    -            static_cast<ColumnVectorsValueAccessor *>(derived_accessor));
    +    constexpr bool key_only_v = decltype(key_only)::value;
    +    constexpr bool has_variable_size_v = decltype(has_variable_size)::value;
    +
    +    if (!has_derived_accessor) {
    --- End diff --
    
    Minor suggestion regarding branch conditions: which is the most common case, `has_derived_accessor`
is `true` or `false`?


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