Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: enable null_as_false when build push down filter in late materialization #9918

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dbms/src/Debug/MockStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ BlockInputStreamPtr MockStorage::getStreamFromDeltaMerge(
rf_max_wait_time_ms,
context.getTimezoneInfo());
auto [before_where, filter_column_name, project_after_where]
= analyzer->buildPushDownExecutor(filter_conditions->conditions);
= analyzer->buildPushDownFilter(filter_conditions->conditions, true);
BlockInputStreams ins = storage->read(
column_names,
query_info,
Expand Down Expand Up @@ -274,7 +274,7 @@ void MockStorage::buildExecFromDeltaMerge(
rf_max_wait_time_ms,
context.getTimezoneInfo());
// Not using `auto [before_where, filter_column_name, project_after_where]` just to make the compiler happy.
auto build_ret = analyzer->buildPushDownExecutor(filter_conditions->conditions);
auto build_ret = analyzer->buildPushDownFilter(filter_conditions->conditions, true);
storage->read(
exec_context_,
group_builder,
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ String DAGExpressionAnalyzer::buildFilterColumn(
return filter_column_name;
}

std::tuple<ExpressionActionsPtr, String, ExpressionActionsPtr> DAGExpressionAnalyzer::buildPushDownExecutor(
std::tuple<ExpressionActionsPtr, String, ExpressionActionsPtr> DAGExpressionAnalyzer::buildPushDownFilter(
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions,
bool null_as_false)
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class DAGExpressionAnalyzer : private boost::noncopyable
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions,
bool null_as_false = false);

std::tuple<ExpressionActionsPtr, String, ExpressionActionsPtr> buildPushDownExecutor(
std::tuple<ExpressionActionsPtr, String, ExpressionActionsPtr> buildPushDownFilter(
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions,
bool null_as_false = false);

Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Flash/Coprocessor/InterpreterUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void executePushedDownFilter(
DAGPipeline & pipeline)
{
auto [before_where, filter_column_name, project_after_where]
= analyzer.buildPushDownExecutor(filter_conditions.conditions, true);
= analyzer.buildPushDownFilter(filter_conditions.conditions, true);

for (auto & stream : pipeline.streams)
{
Expand All @@ -464,7 +464,7 @@ void executePushedDownFilter(
LoggerPtr log)
{
auto [before_where, filter_column_name, project_after_where]
= analyzer.buildPushDownExecutor(filter_conditions.conditions, true);
= analyzer.buildPushDownFilter(filter_conditions.conditions, true);

auto input_header = group_builder.getCurrentHeader();
for (size_t i = 0; i < group_builder.concurrency(); ++i)
Expand Down
3 changes: 2 additions & 1 deletion dbms/src/Storages/DeltaMerge/Filter/PushDownExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ PushDownExecutorPtr PushDownExecutor::build(
}

// build filter expression actions
auto [before_where, filter_column_name, project_after_where] = analyzer->buildPushDownExecutor(pushed_down_filters);
auto [before_where, filter_column_name, project_after_where]
= analyzer->buildPushDownFilter(pushed_down_filters, true);
LOG_DEBUG(tracing_logger, "Push down filter: {}", before_where->dumpActions());

// record current column defines
Expand Down