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
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "4-dev6"
#define DUCKDB_PATCH_VERSION "4-dev14"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 4
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.4.4-dev6"
#define DUCKDB_VERSION "v1.4.4-dev14"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "e92f41065f"
#define DUCKDB_SOURCE_ID "200198b3e0"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/src/optimizer/filter_combiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ FilterPushdownResult FilterCombiner::TryPushdownConstantFilter(TableFilterSet &t
void ReplaceWithBoundReference(unique_ptr<Expression> &root_expr) {
ExpressionIterator::VisitExpressionMutable<BoundColumnRefExpression>(
root_expr, [&](BoundColumnRefExpression &col_ref, unique_ptr<Expression> &expr) {
expr = make_uniq<BoundReferenceExpression>(col_ref.return_type, 0ULL);
expr = make_uniq<BoundReferenceExpression>(col_ref.alias, col_ref.return_type, 0ULL);
});
}

Expand Down
13 changes: 8 additions & 5 deletions src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@

namespace duckdb {

static void GetColumnIndex(unique_ptr<Expression> &expr, idx_t &index) {
static void GetColumnIndex(unique_ptr<Expression> &expr, idx_t &index, string &alias) {
if (expr->type == ExpressionType::BOUND_REF) {
auto &bound_ref = expr->Cast<BoundReferenceExpression>();
index = bound_ref.index;
alias = bound_ref.alias;
return;
}
ExpressionIterator::EnumerateChildren(*expr, [&](unique_ptr<Expression> &child) { GetColumnIndex(child, index); });
ExpressionIterator::EnumerateChildren(*expr,
[&](unique_ptr<Expression> &child) { GetColumnIndex(child, index, alias); });
}

FilterPropagateResult StatisticsPropagator::PropagateTableFilter(ColumnBinding stats_binding, BaseStatistics &stats,
Expand All @@ -32,15 +34,16 @@ FilterPropagateResult StatisticsPropagator::PropagateTableFilter(ColumnBinding s
// get physical storage index of the filter
// since it is a table filter, every storage index is the same
idx_t physical_index = DConstants::INVALID_INDEX;
GetColumnIndex(expr_filter.expr, physical_index);
string column_alias;
GetColumnIndex(expr_filter.expr, physical_index, column_alias);
D_ASSERT(physical_index != DConstants::INVALID_INDEX);

auto column_ref = make_uniq<BoundColumnRefExpression>(stats.GetType(), stats_binding);
auto column_ref = make_uniq<BoundColumnRefExpression>(column_alias, stats.GetType(), stats_binding);
auto filter_expr = expr_filter.ToExpression(*column_ref);
// handle the filter before updating the statistics
// otherwise the filter can be pruned by the updated statistics
auto propagate_result = HandleFilter(filter_expr);
auto colref = make_uniq<BoundReferenceExpression>(stats.GetType(), physical_index);
auto colref = make_uniq<BoundReferenceExpression>(column_alias, stats.GetType(), physical_index);
UpdateFilterStatistics(*filter_expr);

// replace BoundColumnRefs with BoundRefs
Expand Down
5 changes: 0 additions & 5 deletions src/duckdb/src/storage/data_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, BoundConstraint

// ALTER COLUMN to add a new constraint.

// Clone the storage info vector or the table.
for (const auto &index_info : parent.info->index_storage_infos) {
info->index_storage_infos.push_back(IndexStorageInfo(index_info.name));
}

// Bind all indexes.
info->BindIndexes(context);

Expand Down