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
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,19 @@ static idx_t TemplatedSelectOperation(Vector &left, Vector &right, optional_ptr<
false_sel.get());
case PhysicalType::LIST:
case PhysicalType::STRUCT:
case PhysicalType::ARRAY:
return NestedSelectOperation<OP>(left, right, sel, count, true_sel, false_sel, null_mask);
case PhysicalType::ARRAY: {
auto result_count = NestedSelectOperation<OP>(left, right, sel, count, true_sel, false_sel, null_mask);
if (true_sel && result_count > 0) {
std::sort(true_sel->data(), true_sel->data() + result_count);
}
if (false_sel) {
idx_t false_count = count - result_count;
if (false_count > 0) {
std::sort(false_sel->data(), false_sel->data() + false_count);
}
}
return result_count;
}
default:
throw InternalException("Invalid type for comparison");
}
Expand Down
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 "2-dev291"
#define DUCKDB_PATCH_VERSION "2-dev305"
#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.2-dev291"
#define DUCKDB_VERSION "v1.4.2-dev305"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "396c86228b"
#define DUCKDB_SOURCE_ID "8090b8d52e"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/duckdb/src/include/duckdb/main/extension_entries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
{"iceberg_metadata", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"iceberg_scan", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"iceberg_snapshots", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"iceberg_to_ducklake", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"icu_calendar_names", "icu", CatalogType::TABLE_FUNCTION_ENTRY},
{"icu_collate_af", "icu", CatalogType::SCALAR_FUNCTION_ENTRY},
Expand Down Expand Up @@ -525,6 +526,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
{"regr_sxx", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
{"regr_sxy", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
{"regr_syy", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
{"remove_iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"repeat", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
{"replace", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
{"replace_type", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
Expand All @@ -540,6 +542,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
{"rtrim", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
{"sem", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
{"set_bit", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
{"set_iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
{"setseed", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
{"shapefile_meta", "spatial", CatalogType::TABLE_FUNCTION_ENTRY},
{"sign", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
Expand Down
18 changes: 14 additions & 4 deletions src/duckdb/src/planner/binder/statement/bind_merge_into.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,20 @@ unique_ptr<BoundMergeIntoAction> Binder::BindMergeAction(LogicalMergeInto &merge
auto result = make_uniq<BoundMergeIntoAction>();
result->action_type = action.action_type;
if (action.condition) {
ProjectionBinder proj_binder(*this, context, proj_index, expressions, "WHERE clause");
proj_binder.target_type = LogicalType::BOOLEAN;
auto cond = proj_binder.Bind(action.condition);
result->condition = std::move(cond);
if (action.condition->HasSubquery()) {
// if we have a subquery we need to execute the condition outside of the MERGE INTO statement
WhereBinder where_binder(*this, context);
auto cond = where_binder.Bind(action.condition);
PlanSubqueries(cond, root);
result->condition =
make_uniq<BoundColumnRefExpression>(cond->return_type, ColumnBinding(proj_index, expressions.size()));
expressions.push_back(std::move(cond));
} else {
ProjectionBinder proj_binder(*this, context, proj_index, expressions, "WHERE clause");
proj_binder.target_type = LogicalType::BOOLEAN;
auto cond = proj_binder.Bind(action.condition);
result->condition = std::move(cond);
}
}
switch (action.action_type) {
case MergeActionType::MERGE_UPDATE: {
Expand Down
3 changes: 2 additions & 1 deletion src/duckdb/src/storage/table/column_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ bool PersistentCollectionData::HasUpdates() const {
}

PersistentColumnData ColumnData::Serialize() {
PersistentColumnData result(type.InternalType(), GetDataPointers());
auto result = count ? PersistentColumnData(type.InternalType(), GetDataPointers())
: PersistentColumnData(type.InternalType());
result.has_updates = HasUpdates();
return result;
}
Expand Down