Skip to content

Commit 5fb7ae0

Browse files
liujiayi771zhouyuan
authored andcommitted
disable by default
1 parent c4c4b6b commit 5fb7ae0

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

velox/core/QueryConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ class QueryConfig {
743743
}
744744

745745
int32_t abandonBuildNoDupHashMinPct() const {
746-
return get<int32_t>(kAbandonBuildNoDupHashMinPct, 70);
746+
return get<int32_t>(kAbandonBuildNoDupHashMinPct, 0);
747747
}
748748

749749
int32_t maxElementsSizeInRepeatAndSequence() const {

velox/docs/configs.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ Generic Configuration
4646
* - abandon_build_no_dup_hash_min_rows
4747
- integer
4848
- 100,000
49-
- Number of input rows to receive before starting to check whether to abandon building a HashTable without duplicates in HashBuild for left semi/anti join.
49+
- Number of input rows to receive before starting to check whether to abandon building a HashTable without
50+
duplicates in HashBuild for left semi/anti join.
5051
* - abandon_build_no_dup_hash_min_pct
5152
- integer
52-
- 70
53-
- Abandons building a HashTable without duplicates in HashBuild for left semi/anti join if the percentage of distinct keys in the HashTable exceeds this threshold.
53+
- 0
54+
- Abandons building a HashTable without duplicates in HashBuild for left semi/anti join if the percentage of
55+
distinct keys in the HashTable exceeds this threshold. Zero means 'disable this optimization'.
5456
* - session_timezone
5557
- string
5658
-

velox/exec/HashBuild.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ void HashBuild::setupTable() {
183183
}
184184
lookup_ = std::make_unique<HashLookup>(table_->hashers(), pool());
185185
analyzeKeys_ = table_->hashMode() != BaseHashTable::HashMode::kHash;
186+
if (abandonBuildNoDupHashMinPct_ == 0) {
187+
// Building a HashTable without duplicates is disabled if
188+
// abandonBuildNoDupHashMinPct_ is 0.
189+
abandonBuildNoDupHash_ = true;
190+
table_->joinTableMayHaveDuplicates();
191+
}
186192
}
187193

188194
void HashBuild::setupSpiller(SpillPartition* spillPartition) {

0 commit comments

Comments
 (0)