Skip to content
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
12 changes: 8 additions & 4 deletions src/optimizer/aggregate_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ static bool CanPushAggregate(LogicalAggregate &aggr) {
if (agg_expr.GetOrderBysMutable() && !agg_expr.GetOrderBysMutable()->orders.empty()) {
return false;
}
if (PUSHABLE_AGGREGATES.find(agg_expr.FunctionMutable().GetName()) == PUSHABLE_AGGREGATES.end()) {
if (PUSHABLE_AGGREGATES.find(agg_expr.FunctionMutable().GetName().GetIdentifierName()) ==
PUSHABLE_AGGREGATES.end()) {
return false;
}
if (agg_expr.FunctionMutable().GetName() != "count_star") {
Expand Down Expand Up @@ -192,8 +193,8 @@ static PushedAggregate TryPushAggregateToMySQL(const AggregateOptimizer::Config
}
auto column_name = get.names[table_col_idx];
auto scan_config = table_scan::FilterPushdown::CreateConfig('`', '\'', config.escape_style);
auto new_filter =
table_scan::FilterPushdown::TransformFilter(scan_config, column_name, entry.Filter(), table_col_idx);
auto new_filter = table_scan::FilterPushdown::TransformFilter(scan_config, column_name.GetIdentifierName(),
entry.Filter(), table_col_idx);
if (new_filter.empty()) {
return res;
}
Expand All @@ -208,7 +209,10 @@ static PushedAggregate TryPushAggregateToMySQL(const AggregateOptimizer::Config
}

get.returned_types = new_types;
get.names = new_names;
get.names.clear();
for (auto &new_name : new_names) {
get.names.push_back(Identifier(new_name));
}
vector<ColumnIndex> new_column_ids;
for (idx_t i = 0; i < new_types.size(); i++) {
new_column_ids.push_back(ColumnIndex(i));
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/optimizer_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TracedBindingColumn OptimizerUtil::TraceBindingToColumn(ColumnBinding binding, L
if (actual_col_idx >= get.names.size()) {
return res;
}
res.col_name = get.names[actual_col_idx];
res.col_name = get.names[actual_col_idx].GetIdentifierName();
res.col_type = get.returned_types[actual_col_idx];
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/order_by_and_limit_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static string TraceColumnToGet(const OrderByAndLimitOptimizer::Config &config, E
return std::string();
}
auto query_config = query::QueryWriter::CreateConfig(config.identifier_quote, config.escape_style);
return query::QueryWriter::WriteQuotedAndEscaped(query_config, get.names[actual_col_idx]);
return query::QueryWriter::WriteQuotedAndEscaped(query_config, get.names[actual_col_idx].GetIdentifierName());
}

static string TryBuildOrderByClause(const OrderByAndLimitOptimizer::Config &config, vector<BoundOrderByNode> &orders,
Expand Down
4 changes: 2 additions & 2 deletions src/table_scan/filter_pushdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ string FilterPushdown::TransformExpressionSubject(const query::QueryWriter::Conf
if (struct_type.id() != LogicalTypeId::STRUCT || StructType::IsUnnamed(struct_type)) {
return string();
}
auto child_name = query::QueryWriter::WriteQuotedAndEscaped(identifier_config,
StructType::GetChildName(struct_type, child_idx));
auto child_name = query::QueryWriter::WriteQuotedAndEscaped(
identifier_config, StructType::GetChildName(struct_type, child_idx).GetIdentifierName());
return "(" + parent_name + ")." + child_name;
}
default:
Expand Down
Loading