Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
  • Loading branch information
windtalker committed Jul 19, 2023
1 parent cbfacd9 commit dbdfbc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dbms/src/Interpreters/HashJoinSpillContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ SpillConfig HashJoinSpillContext::createProbeSpillConfig(const String & spill_id
std::vector<size_t> HashJoinSpillContext::getPartitionsToSpill()
{
std::vector<size_t> ret;
if (!in_spillable_stage)
if (!in_spillable_stage || isSpillEnabled())
return ret;
Int64 target_partition_index = -1;
if ((operator_spill_threshold > 0 && getTotalRevocableMemoryImpl() <= static_cast<Int64>(operator_spill_threshold)))
if (operator_spill_threshold <= 0 || getTotalRevocableMemoryImpl() <= static_cast<Int64>(operator_spill_threshold))
{
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Interpreters/Join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,10 +1787,10 @@ void Join::spillMostMemoryUsedPartitionIfNeed()
if (restore_round == 1 && spilled_partition_indexes.size() >= partitions.size() / 2)
return;
#endif
RUNTIME_CHECK_MSG(build_concurrency > 1, "spilling is not is not supported when stream size = 1, please increase max_threads or set max_bytes_before_external_join = 0.");
auto partitions_to_be_spilled = hash_join_spill_context->getPartitionsToSpill();
if (partitions_to_be_spilled.empty())
return;
RUNTIME_CHECK_MSG(build_concurrency > 1, "spilling is not is not supported when stream size = 1, please increase max_threads or set max_bytes_before_external_join = 0.");
target_partition_index = partitions_to_be_spilled[0];

LOG_INFO(log, fmt::format("Join with restore round: {}, used {} bytes, will spill partition: {}.", restore_round, getTotalByteCount(), target_partition_index));
Expand Down

0 comments on commit dbdfbc8

Please sign in to comment.