use sanitizeBlock

This commit is contained in:
ongkong 2023-04-20 23:12:37 -07:00 committed by Vladimir C
parent a8e63abbb4
commit 35a736f811

View File

@ -1066,13 +1066,6 @@ static std::shared_ptr<IJoin> chooseJoinAlgorithm(
{
const auto & settings = context->getSettings();
Block left_sample_block(left_sample_columns);
for (auto & column : left_sample_block)
{
if (!column.column)
column.column = column.type->createColumn();
}
Block right_sample_block = joined_plan->getCurrentDataStream().header;
std::vector<String> tried_algorithms;
@ -1115,7 +1108,7 @@ static std::shared_ptr<IJoin> chooseJoinAlgorithm(
return std::make_shared<FullSortingMergeJoin>(analyzed_join, right_sample_block);
}
if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::GRACE_HASH))
if (Block left_sample_block(left_sample_columns); analyzed_join->isEnabledAlgorithm(JoinAlgorithm::GRACE_HASH) && sanitizeBlock(left_sample_block, false))
{
tried_algorithms.push_back(toString(JoinAlgorithm::GRACE_HASH));
if (GraceHashJoin::isSupported(analyzed_join))