Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lgbo-ustc committed Apr 22, 2024
1 parent 4f61d92 commit d811522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/Analyzer/Passes/QueryAnalysisPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@

#include <boost/algorithm/string.hpp>

#include <Poco/Logger.h>
#include <Common/logger_useful.h>

namespace ProfileEvents
{
extern const Event ScalarSubqueriesGlobalCacheHit;
Expand Down Expand Up @@ -8256,11 +8253,9 @@ QueryAnalysisPass::QueryAnalysisPass(bool only_analyze_) : only_analyze(only_ana

void QueryAnalysisPass::run(QueryTreeNodePtr & query_tree_node, ContextPtr context)
{
LOG_ERROR(getLogger("QueryAnalysisPass"), "xxx query_tree_node:\n{}", query_tree_node->dumpTree());
QueryAnalyzer analyzer(only_analyze);
analyzer.resolve(query_tree_node, table_expression, context);
createUniqueTableAliases(query_tree_node, table_expression, context);
LOG_ERROR(getLogger("QueryAnalysisPass"), "xxx - query_tree_node:\n{}", query_tree_node->dumpTree());
}

}
7 changes: 3 additions & 4 deletions src/Analyzer/Passes/RewriteJoinUseNullsPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,17 @@ class RewriteJoinUseNullsTableExpressionVisitor : public InDepthQueryTreeVisitor
*/
void RewriteJoinUseNullsPass::run(QueryTreeNodePtr & query_tree_node, ContextPtr context)
{
bool flag = true;
if (context->getSettingsRef().join_use_nulls && flag)
if (context->getSettingsRef().join_use_nulls)
{
LOG_ERROR(getLogger("RewriteJoinUseNullsPass"), "input query tree:\n{}", query_tree_node->dumpTree());
LOG_TRACE(getLogger("RewriteJoinUseNullsPass"), "input query tree:\n{}", query_tree_node->dumpTree());
std::unordered_map<QueryTreeNodePtr, std::unordered_set<QueryTreeNodePtr>> result_requiredColumns;
/// Collect required columns for each table expression
CollectTableRequiredColumnsVisitor table_required_columns_visitor(result_requiredColumns, context);
table_required_columns_visitor.visit(query_tree_node);
/// Rewrite table expressions to add a projection of converting columns to nullable if needed.
RewriteJoinUseNullsTableExpressionVisitor table_expression_visitor(result_requiredColumns, context);
table_expression_visitor.visit(query_tree_node);
LOG_ERROR(getLogger("RewriteJoinUseNullsPass"), "Query tree after RewriteJoinUseNullsTableExpressionVisitor:\n{}", query_tree_node->dumpTree());
LOG_TRACE(getLogger("RewriteJoinUseNullsPass"), "Query tree after RewriteJoinUseNullsTableExpressionVisitor:\n{}", query_tree_node->dumpTree());
}
}
}

0 comments on commit d811522

Please sign in to comment.