duckdb 0.5.1-dev2.0 → 0.5.1-dev29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +62 -23
- package/src/duckdb.hpp +4 -4
- package/src/parquet-amalgamation.cpp +33948 -33948
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -151925,6 +151925,7 @@ unique_ptr<NodeStatistics> StatisticsPropagator::PropagateStatistics(LogicalGet
|
|
|
151925
151925
|
|
|
151926
151926
|
|
|
151927
151927
|
|
|
151928
|
+
|
|
151928
151929
|
namespace duckdb {
|
|
151929
151930
|
|
|
151930
151931
|
void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, unique_ptr<LogicalOperator> *node_ptr) {
|
|
@@ -151954,10 +151955,15 @@ void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, uniq
|
|
|
151954
151955
|
// semi or inner join on false; entire node can be pruned
|
|
151955
151956
|
ReplaceWithEmptyResult(*node_ptr);
|
|
151956
151957
|
return;
|
|
151957
|
-
case JoinType::ANTI:
|
|
151958
|
-
//
|
|
151959
|
-
|
|
151958
|
+
case JoinType::ANTI: {
|
|
151959
|
+
// when the right child has data, return the left child
|
|
151960
|
+
// when the right child has no data, return an empty set
|
|
151961
|
+
auto limit = make_unique<LogicalLimit>(1, 0, nullptr, nullptr);
|
|
151962
|
+
limit->AddChild(move(join.children[1]));
|
|
151963
|
+
auto cross_product = LogicalCrossProduct::Create(move(join.children[0]), move(limit));
|
|
151964
|
+
*node_ptr = move(cross_product);
|
|
151960
151965
|
return;
|
|
151966
|
+
}
|
|
151961
151967
|
case JoinType::LEFT:
|
|
151962
151968
|
// anti/left outer join: replace right side with empty node
|
|
151963
151969
|
ReplaceWithEmptyResult(join.children[1]);
|
|
@@ -151985,10 +151991,15 @@ void StatisticsPropagator::PropagateStatistics(LogicalComparisonJoin &join, uniq
|
|
|
151985
151991
|
} else {
|
|
151986
151992
|
// this is the only condition and it is always true: all conditions are true
|
|
151987
151993
|
switch (join.join_type) {
|
|
151988
|
-
case JoinType::SEMI:
|
|
151989
|
-
//
|
|
151990
|
-
|
|
151994
|
+
case JoinType::SEMI: {
|
|
151995
|
+
// when the right child has data, return the left child
|
|
151996
|
+
// when the right child has no data, return an empty set
|
|
151997
|
+
auto limit = make_unique<LogicalLimit>(1, 0, nullptr, nullptr);
|
|
151998
|
+
limit->AddChild(move(join.children[1]));
|
|
151999
|
+
auto cross_product = LogicalCrossProduct::Create(move(join.children[0]), move(limit));
|
|
152000
|
+
*node_ptr = move(cross_product);
|
|
151991
152001
|
return;
|
|
152002
|
+
}
|
|
151992
152003
|
case JoinType::INNER:
|
|
151993
152004
|
case JoinType::LEFT:
|
|
151994
152005
|
case JoinType::RIGHT:
|
|
@@ -152105,6 +152116,7 @@ unique_ptr<NodeStatistics> StatisticsPropagator::PropagateStatistics(LogicalJoin
|
|
|
152105
152116
|
// then propagate into the join conditions
|
|
152106
152117
|
switch (join.type) {
|
|
152107
152118
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
|
152119
|
+
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
|
|
152108
152120
|
PropagateStatistics((LogicalComparisonJoin &)join, node_ptr);
|
|
152109
152121
|
break;
|
|
152110
152122
|
case LogicalOperatorType::LOGICAL_ANY_JOIN:
|
|
@@ -171765,7 +171777,7 @@ LogicalType Transformer::TransformTypeName(duckdb_libpgquery::PGTypeName *type_n
|
|
|
171765
171777
|
|
|
171766
171778
|
result_type = LogicalType::MAP(move(children));
|
|
171767
171779
|
} else {
|
|
171768
|
-
|
|
171780
|
+
int64_t width, scale;
|
|
171769
171781
|
if (base_type == LogicalTypeId::DECIMAL) {
|
|
171770
171782
|
// default decimal width/scale
|
|
171771
171783
|
width = 18;
|
|
@@ -180863,6 +180875,9 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
180863
180875
|
|
|
180864
180876
|
|
|
180865
180877
|
|
|
180878
|
+
|
|
180879
|
+
|
|
180880
|
+
|
|
180866
180881
|
//===----------------------------------------------------------------------===//
|
|
180867
180882
|
// DuckDB
|
|
180868
180883
|
//
|
|
@@ -180897,10 +180912,6 @@ protected:
|
|
|
180897
180912
|
|
|
180898
180913
|
|
|
180899
180914
|
|
|
180900
|
-
|
|
180901
|
-
|
|
180902
|
-
|
|
180903
|
-
|
|
180904
180915
|
//===----------------------------------------------------------------------===//
|
|
180905
180916
|
// DuckDB
|
|
180906
180917
|
//
|
|
@@ -180933,6 +180944,8 @@ public:
|
|
|
180933
180944
|
};
|
|
180934
180945
|
} // namespace duckdb
|
|
180935
180946
|
|
|
180947
|
+
|
|
180948
|
+
|
|
180936
180949
|
#include <algorithm>
|
|
180937
180950
|
|
|
180938
180951
|
namespace duckdb {
|
|
@@ -181103,10 +181116,10 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) {
|
|
|
181103
181116
|
if (column.Generated()) {
|
|
181104
181117
|
throw BinderException("Cant update column \"%s\" because it is a generated column!", column.Name());
|
|
181105
181118
|
}
|
|
181106
|
-
if (std::find(update->columns.begin(), update->columns.end(), column.
|
|
181119
|
+
if (std::find(update->columns.begin(), update->columns.end(), column.StorageOid()) != update->columns.end()) {
|
|
181107
181120
|
throw BinderException("Multiple assignments to same column \"%s\"", colname);
|
|
181108
181121
|
}
|
|
181109
|
-
update->columns.push_back(column.
|
|
181122
|
+
update->columns.push_back(column.StorageOid());
|
|
181110
181123
|
|
|
181111
181124
|
if (expr->type == ExpressionType::VALUE_DEFAULT) {
|
|
181112
181125
|
update->expressions.push_back(make_unique<BoundDefaultExpression>(column.Type()));
|
|
@@ -181188,7 +181201,20 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
181188
181201
|
auto &get = (LogicalGet &)*ref->get;
|
|
181189
181202
|
columns.insert(columns.end(), get.names.begin(), get.names.end());
|
|
181190
181203
|
}
|
|
181204
|
+
|
|
181205
|
+
case_insensitive_set_t column_name_set;
|
|
181206
|
+
vector<string> non_generated_column_names;
|
|
181191
181207
|
for (auto &col_name : columns) {
|
|
181208
|
+
if (column_name_set.count(col_name) > 0) {
|
|
181209
|
+
throw BinderException("Vacuum the same column twice(same name in column name list)");
|
|
181210
|
+
}
|
|
181211
|
+
column_name_set.insert(col_name);
|
|
181212
|
+
auto &col = ref->table->GetColumn(col_name);
|
|
181213
|
+
// ignore generated column
|
|
181214
|
+
if (col.Generated()) {
|
|
181215
|
+
continue;
|
|
181216
|
+
}
|
|
181217
|
+
non_generated_column_names.push_back(col_name);
|
|
181192
181218
|
ColumnRefExpression colref(col_name, ref->table->name);
|
|
181193
181219
|
auto result = bind_context.BindColumn(colref, 0);
|
|
181194
181220
|
if (result.HasError()) {
|
|
@@ -181196,17 +181222,29 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
181196
181222
|
}
|
|
181197
181223
|
select_list.push_back(move(result.expression));
|
|
181198
181224
|
}
|
|
181199
|
-
|
|
181200
|
-
|
|
181201
|
-
|
|
181202
|
-
|
|
181203
|
-
stmt.info->column_id_map[i] = get.column_ids[i];
|
|
181204
|
-
}
|
|
181225
|
+
stmt.info->columns = move(non_generated_column_names);
|
|
181226
|
+
if (!select_list.empty()) {
|
|
181227
|
+
auto table_scan = CreatePlan(*ref);
|
|
181228
|
+
D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
|
|
181205
181229
|
|
|
181206
|
-
|
|
181207
|
-
|
|
181230
|
+
auto &get = (LogicalGet &)*table_scan;
|
|
181231
|
+
|
|
181232
|
+
D_ASSERT(select_list.size() == get.column_ids.size());
|
|
181233
|
+
D_ASSERT(stmt.info->columns.size() == get.column_ids.size());
|
|
181234
|
+
for (idx_t i = 0; i < get.column_ids.size(); i++) {
|
|
181235
|
+
stmt.info->column_id_map[i] = ref->table->columns[get.column_ids[i]].StorageOid();
|
|
181236
|
+
}
|
|
181237
|
+
|
|
181238
|
+
auto projection = make_unique<LogicalProjection>(GenerateTableIndex(), move(select_list));
|
|
181239
|
+
projection->children.push_back(move(table_scan));
|
|
181208
181240
|
|
|
181209
|
-
|
|
181241
|
+
root = move(projection);
|
|
181242
|
+
} else {
|
|
181243
|
+
// eg. CREATE TABLE test (x AS (1));
|
|
181244
|
+
// ANALYZE test;
|
|
181245
|
+
// Make it not a SINK so it doesn't have to do anything
|
|
181246
|
+
stmt.info->has_table = false;
|
|
181247
|
+
}
|
|
181210
181248
|
}
|
|
181211
181249
|
auto vacuum = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_VACUUM, move(stmt.info));
|
|
181212
181250
|
if (root) {
|
|
@@ -186042,6 +186080,7 @@ unique_ptr<TableFilter> ConjunctionAndFilter::Deserialize(FieldReader &source) {
|
|
|
186042
186080
|
|
|
186043
186081
|
|
|
186044
186082
|
|
|
186083
|
+
|
|
186045
186084
|
namespace duckdb {
|
|
186046
186085
|
|
|
186047
186086
|
ConstantFilter::ConstantFilter(ExpressionType comparison_type_p, Value constant_p)
|
|
@@ -186065,7 +186104,7 @@ FilterPropagateResult ConstantFilter::CheckStatistics(BaseStatistics &stats) {
|
|
|
186065
186104
|
case PhysicalType::DOUBLE:
|
|
186066
186105
|
return ((NumericStatistics &)stats).CheckZonemap(comparison_type, constant);
|
|
186067
186106
|
case PhysicalType::VARCHAR:
|
|
186068
|
-
return ((StringStatistics &)stats).CheckZonemap(comparison_type, constant
|
|
186107
|
+
return ((StringStatistics &)stats).CheckZonemap(comparison_type, StringValue::Get(constant));
|
|
186069
186108
|
default:
|
|
186070
186109
|
return FilterPropagateResult::NO_PRUNING_POSSIBLE;
|
|
186071
186110
|
}
|
package/src/duckdb.hpp
CHANGED
|
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
13
|
#define DUCKDB_AMALGAMATION_EXTENDED 1
|
|
14
|
-
#define DUCKDB_SOURCE_ID "
|
|
15
|
-
#define DUCKDB_VERSION "v0.5.1-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "9bf9c4b8f"
|
|
15
|
+
#define DUCKDB_VERSION "v0.5.1-dev29"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -3372,8 +3372,8 @@ public:
|
|
|
3372
3372
|
DUCKDB_API AllocatedData(Allocator &allocator, data_ptr_t pointer, idx_t allocated_size);
|
|
3373
3373
|
DUCKDB_API ~AllocatedData();
|
|
3374
3374
|
// disable copy constructors
|
|
3375
|
-
|
|
3376
|
-
|
|
3375
|
+
AllocatedData(const AllocatedData &other) = delete;
|
|
3376
|
+
AllocatedData &operator=(const AllocatedData &) = delete;
|
|
3377
3377
|
//! enable move constructors
|
|
3378
3378
|
DUCKDB_API AllocatedData(AllocatedData &&other) noexcept;
|
|
3379
3379
|
DUCKDB_API AllocatedData &operator=(AllocatedData &&) noexcept;
|