From 450e49fd28e7cd574a2eb6ec4e8ed1295d45611c Mon Sep 17 00:00:00 2001 From: vdimir Date: Tue, 29 Jun 2021 12:55:34 +0300 Subject: [PATCH] Throw type mismatch exception from inferJoinKeyCommonType --- src/Interpreters/TableJoin.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Interpreters/TableJoin.cpp b/src/Interpreters/TableJoin.cpp index e61318788a2..a39aa9e6731 100644 --- a/src/Interpreters/TableJoin.cpp +++ b/src/Interpreters/TableJoin.cpp @@ -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"), - "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; + 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()); } if (!allow_right && !common_type->equals(*rtype->second)) { - LOG_DEBUG(&Poco::Logger::get("TableJoin"), - "Can't change type for right table: {}: {} -> {}.", - key_names_right[i], rtype->second->getName(), common_type->getName()); - continue; + throw DB::Exception(ErrorCodes::TYPE_MISMATCH, + "Can't change type for right table: {}: {} -> {}.", + key_names_right[i], rtype->second->getName(), common_type->getName()); } left_type_map[key_names_left[i]] = right_type_map[key_names_right[i]] = common_type; }