quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [02/18] incubator-quickstep git commit: Fix the bug with SingleIdentityHashFilter when filter_cardinality is 0.
Date Wed, 08 Feb 2017 08:53:45 GMT
Fix the bug with SingleIdentityHashFilter when filter_cardinality is 0.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/669a74c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/669a74c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/669a74c7

Branch: refs/heads/tmb_poll_interval
Commit: 669a74c71fde158106e72fba936de2104998aa61
Parents: aef1c35
Author: jianqiao <jianqiao@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Authored: Sun Feb 5 15:46:48 2017 -0600
Committer: jianqiao <jianqiao@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Tue Feb 7 10:16:01 2017 -0600

----------------------------------------------------------------------
 query_optimizer/rules/AttachLIPFilters.cpp      | 3 ++-
 utility/lip_filter/SingleIdentityHashFilter.hpp | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/669a74c7/query_optimizer/rules/AttachLIPFilters.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/rules/AttachLIPFilters.cpp b/query_optimizer/rules/AttachLIPFilters.cpp
index 48b68bc..4b6ac59 100644
--- a/query_optimizer/rules/AttachLIPFilters.cpp
+++ b/query_optimizer/rules/AttachLIPFilters.cpp
@@ -19,6 +19,7 @@
 
 #include "query_optimizer/rules/AttachLIPFilters.hpp"
 
+#include <algorithm>
 #include <map>
 #include <set>
 #include <unordered_set>
@@ -128,7 +129,7 @@ void AttachLIPFilters::attachLIPFilters(
           lip_filter_configuration_->addBuildInfo(
               P::SingleIdentityHashFilterBuildInfo::Create(
                   pair.second->source_attribute,
-                  pair.second->estimated_cardinality * 8),
+                  std::max(64uL, pair.second->estimated_cardinality * 8u)),
               pair.second->source);
           lip_filter_configuration_->addProbeInfo(
               P::LIPFilterProbeInfo::Create(

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/669a74c7/utility/lip_filter/SingleIdentityHashFilter.hpp
----------------------------------------------------------------------
diff --git a/utility/lip_filter/SingleIdentityHashFilter.hpp b/utility/lip_filter/SingleIdentityHashFilter.hpp
index 2823818..5c0e8a2 100644
--- a/utility/lip_filter/SingleIdentityHashFilter.hpp
+++ b/utility/lip_filter/SingleIdentityHashFilter.hpp
@@ -66,7 +66,7 @@ class SingleIdentityHashFilter : public LIPFilter {
       : LIPFilter(LIPFilterType::kSingleIdentityHashFilter),
         filter_cardinality_(filter_cardinality),
         bit_array_(GetByteSize(filter_cardinality)) {
-    DCHECK_GE(filter_cardinality, 0u);
+    DCHECK_GE(filter_cardinality, 1u);
     std::memset(bit_array_.data(),
                 0x0,
                 sizeof(std::atomic<std::uint8_t>) * GetByteSize(filter_cardinality));


Mime
View raw message