Fixing tests.

This commit is contained in:
Nikolai Kochetov 2024-06-04 14:14:43 +00:00
parent c45f57403b
commit c8def45cc2
2 changed files with 24 additions and 15 deletions

View File

@ -176,16 +176,16 @@ DataTypePtr removeNullableOrLowCardinalityNullable(const DataTypePtr & type)
} }
bool canContainNull(const IDataType & type) bool canContainNull(const IDataType & type)
{ {
if (type.isNullable() || type.isLowCardinalityNullable() || isDynamic(type)) if (type.isNullable() || type.isLowCardinalityNullable() || isDynamic(type))
return true; return true;
if (const auto * variant = typeid_cast<const DataTypeVariant *>(&type)) if (const auto * variant = typeid_cast<const DataTypeVariant *>(&type))
for (const auto & elem : variant->getVariants()) for (const auto & elem : variant->getVariants())
if (canContainNull(*elem)) if (canContainNull(*elem))
return true; return true;
return false; return false;
} }
} }

View File

@ -539,8 +539,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo
if (query_node.hasWhere()) if (query_node.hasWhere())
{ {
where_analysis_result_optional = analyzeFilter(query_node.getWhere(), current_output_columns, planner_context, actions_chain); where_analysis_result_optional = analyzeFilter(query_node.getWhere(), current_output_columns, planner_context, actions_chain);
where_action_step_index_optional = actions_chain.getLastStepIndex(); if (where_analysis_result_optional)
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); {
where_action_step_index_optional = actions_chain.getLastStepIndex();
current_output_columns = actions_chain.getLastStepAvailableOutputColumns();
}
} }
auto aggregation_analysis_result_optional = analyzeAggregation(query_tree, current_output_columns, planner_context, actions_chain); auto aggregation_analysis_result_optional = analyzeAggregation(query_tree, current_output_columns, planner_context, actions_chain);
@ -553,8 +556,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo
if (query_node.hasHaving()) if (query_node.hasHaving())
{ {
having_analysis_result_optional = analyzeFilter(query_node.getHaving(), current_output_columns, planner_context, actions_chain); having_analysis_result_optional = analyzeFilter(query_node.getHaving(), current_output_columns, planner_context, actions_chain);
having_action_step_index_optional = actions_chain.getLastStepIndex(); if (having_analysis_result_optional)
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); {
having_action_step_index_optional = actions_chain.getLastStepIndex();
current_output_columns = actions_chain.getLastStepAvailableOutputColumns();
}
} }
auto window_analysis_result_optional = analyzeWindow(query_tree, current_output_columns, planner_context, actions_chain); auto window_analysis_result_optional = analyzeWindow(query_tree, current_output_columns, planner_context, actions_chain);
@ -567,8 +573,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo
if (query_node.hasQualify()) if (query_node.hasQualify())
{ {
qualify_analysis_result_optional = analyzeFilter(query_node.getQualify(), current_output_columns, planner_context, actions_chain); qualify_analysis_result_optional = analyzeFilter(query_node.getQualify(), current_output_columns, planner_context, actions_chain);
qualify_action_step_index_optional = actions_chain.getLastStepIndex(); if (qualify_analysis_result_optional)
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); {
qualify_action_step_index_optional = actions_chain.getLastStepIndex();
current_output_columns = actions_chain.getLastStepAvailableOutputColumns();
}
} }
auto projection_analysis_result = analyzeProjection(query_node, current_output_columns, planner_context, actions_chain); auto projection_analysis_result = analyzeProjection(query_node, current_output_columns, planner_context, actions_chain);