Skip to content

Commit 9eabdb0

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to 027bc16ee8
1 parent 26072f3 commit 9eabdb0

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

src/duckdb/extension/json/json_functions/json_table_in_out.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static unique_ptr<GlobalTableFunctionState> JSONTableInOutInitGlobal(ClientConte
9797
}
9898
}
9999
}
100-
return result;
100+
return std::move(result);
101101
}
102102

103103
struct JSONTableInOutRecursionNode {

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "0-dev3294"
2+
#define DUCKDB_PATCH_VERSION "0-dev3309"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 3
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.3.0-dev3294"
11+
#define DUCKDB_VERSION "v1.3.0-dev3309"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "30e907b52f"
14+
#define DUCKDB_SOURCE_ID "027bc16ee8"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/main/connection.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class Connection {
6262
//! Interrupt execution of the current query
6363
DUCKDB_API void Interrupt();
6464

65+
//! Get query progress of current query
66+
DUCKDB_API double GetQueryProgress();
67+
6568
//! Enable query profiling
6669
DUCKDB_API void EnableProfiling();
6770
//! Disable query profiling

src/duckdb/src/main/connection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ void Connection::Interrupt() {
7474
context->Interrupt();
7575
}
7676

77+
double Connection::GetQueryProgress() {
78+
return context->GetQueryProgress().GetPercentage();
79+
}
80+
7781
void Connection::EnableProfiling() {
7882
context->EnableProfiling();
7983
}

src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ FilterPropagateResult StatisticsPropagator::HandleFilter(unique_ptr<Expression>
230230
if (ExpressionIsConstant(*condition, Value::BOOLEAN(true))) {
231231
return FilterPropagateResult::FILTER_ALWAYS_TRUE;
232232
}
233+
234+
if (ExpressionIsConstantOrNull(*condition, Value::BOOLEAN(true))) {
235+
return FilterPropagateResult::FILTER_TRUE_OR_NULL;
236+
}
237+
233238
if (ExpressionIsConstant(*condition, Value::BOOLEAN(false)) ||
234239
ExpressionIsConstantOrNull(*condition, Value::BOOLEAN(false))) {
235240
return FilterPropagateResult::FILTER_FALSE_OR_NULL;

src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
#include "duckdb/common/helper.hpp"
12
#include "duckdb/optimizer/statistics_propagator.hpp"
23
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
34
#include "duckdb/planner/filter/conjunction_filter.hpp"
45
#include "duckdb/planner/filter/constant_filter.hpp"
56
#include "duckdb/planner/filter/expression_filter.hpp"
7+
#include "duckdb/planner/filter/null_filter.hpp"
68
#include "duckdb/planner/operator/logical_get.hpp"
79
#include "duckdb/planner/table_filter.hpp"
810

@@ -14,8 +16,12 @@ FilterPropagateResult StatisticsPropagator::PropagateTableFilter(ColumnBinding s
1416
auto &expr_filter = filter.Cast<ExpressionFilter>();
1517
auto column_ref = make_uniq<BoundColumnRefExpression>(stats.GetType(), stats_binding);
1618
auto filter_expr = expr_filter.ToExpression(*column_ref);
17-
UpdateFilterStatistics(*filter_expr);
18-
return HandleFilter(filter_expr);
19+
// handle the filter before updating the statistics
20+
// otherwise the filter can be pruned by the updated statistics
21+
auto copy_expr = filter_expr->Copy();
22+
auto propagate_result = HandleFilter(filter_expr);
23+
UpdateFilterStatistics(*copy_expr);
24+
return propagate_result;
1925
}
2026
return filter.CheckStatistics(stats);
2127
}
@@ -93,6 +99,10 @@ unique_ptr<NodeStatistics> StatisticsPropagator::PropagateStatistics(LogicalGet
9399
// erase this condition
94100
get.table_filters.filters.erase(table_filter_column);
95101
break;
102+
case FilterPropagateResult::FILTER_TRUE_OR_NULL:
103+
// filter is true or null; we can replace this with a not null filter
104+
get.table_filters.filters[table_filter_column] = make_uniq<IsNotNullFilter>();
105+
break;
96106
case FilterPropagateResult::FILTER_FALSE_OR_NULL:
97107
case FilterPropagateResult::FILTER_ALWAYS_FALSE:
98108
// filter is always false; this entire filter should be replaced by an empty result block

0 commit comments

Comments
 (0)