mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Throw type mismatch exception from inferJoinKeyCommonType
This commit is contained in:
parent
df873866c9
commit
450e49fd28
@ -428,19 +428,17 @@ bool TableJoin::inferJoinKeyCommonType(const LeftNamesAndTypes & left, const Rig
|
||||
auto common_type = DB::getLeastSupertype({ltype->second, rtype->second}, false);
|
||||
if (common_type == nullptr || isNothing(common_type))
|
||||
{
|
||||
LOG_DEBUG(&Poco::Logger::get("TableJoin"),
|
||||
throw DB::Exception(ErrorCodes::TYPE_MISMATCH,
|
||||
"Can't infer supertype for joined columns: {}: {} at left, {}: {} at right.",
|
||||
key_names_left[i], ltype->second->getName(),
|
||||
key_names_right[i], rtype->second->getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!allow_right && !common_type->equals(*rtype->second))
|
||||
{
|
||||
LOG_DEBUG(&Poco::Logger::get("TableJoin"),
|
||||
throw DB::Exception(ErrorCodes::TYPE_MISMATCH,
|
||||
"Can't change type for right table: {}: {} -> {}.",
|
||||
key_names_right[i], rtype->second->getName(), common_type->getName());
|
||||
continue;
|
||||
}
|
||||
left_type_map[key_names_left[i]] = right_type_map[key_names_right[i]] = common_type;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user