duckdb 0.3.5-dev653.0 → 0.3.5-dev666.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 +177 -68
- package/src/duckdb.hpp +26 -16
- package/src/parquet-amalgamation.cpp +27711 -27711
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.3.5-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "e5df529e4"
|
|
15
|
+
#define DUCKDB_VERSION "v0.3.5-dev666"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -7791,13 +7791,13 @@ public:
|
|
|
7791
7791
|
}
|
|
7792
7792
|
|
|
7793
7793
|
template <class STATE, class INPUT_TYPE, class RESULT_TYPE, class OP>
|
|
7794
|
-
static void UnaryWindow(Vector &input, FunctionData *bind_data, data_ptr_t state,
|
|
7795
|
-
const FrameBounds &prev, Vector &result, idx_t rid, idx_t bias) {
|
|
7794
|
+
static void UnaryWindow(Vector &input, const ValidityMask &ifilter, FunctionData *bind_data, data_ptr_t state,
|
|
7795
|
+
const FrameBounds &frame, const FrameBounds &prev, Vector &result, idx_t rid, idx_t bias) {
|
|
7796
7796
|
|
|
7797
7797
|
auto idata = FlatVector::GetData<const INPUT_TYPE>(input) - bias;
|
|
7798
7798
|
const auto &ivalid = FlatVector::Validity(input);
|
|
7799
|
-
OP::template Window<STATE, INPUT_TYPE, RESULT_TYPE>(idata, ivalid, bind_data, (STATE *)state, frame,
|
|
7800
|
-
result, rid, bias);
|
|
7799
|
+
OP::template Window<STATE, INPUT_TYPE, RESULT_TYPE>(idata, ifilter, ivalid, bind_data, (STATE *)state, frame,
|
|
7800
|
+
prev, result, rid, bias);
|
|
7801
7801
|
}
|
|
7802
7802
|
|
|
7803
7803
|
template <class STATE_TYPE, class OP>
|
|
@@ -9022,9 +9022,9 @@ typedef void (*aggregate_simple_update_t)(Vector inputs[], FunctionData *bind_da
|
|
|
9022
9022
|
|
|
9023
9023
|
//! The type used for updating complex windowed aggregate functions (optional)
|
|
9024
9024
|
typedef std::pair<idx_t, idx_t> FrameBounds;
|
|
9025
|
-
typedef void (*aggregate_window_t)(Vector inputs[],
|
|
9026
|
-
|
|
9027
|
-
idx_t bias);
|
|
9025
|
+
typedef void (*aggregate_window_t)(Vector inputs[], const ValidityMask &filter_mask, FunctionData *bind_data,
|
|
9026
|
+
idx_t input_count, data_ptr_t state, const FrameBounds &frame,
|
|
9027
|
+
const FrameBounds &prev, Vector &result, idx_t rid, idx_t bias);
|
|
9028
9028
|
|
|
9029
9029
|
class AggregateFunction : public BaseScalarFunction {
|
|
9030
9030
|
public:
|
|
@@ -9191,11 +9191,12 @@ public:
|
|
|
9191
9191
|
}
|
|
9192
9192
|
|
|
9193
9193
|
template <class STATE, class INPUT_TYPE, class RESULT_TYPE, class OP>
|
|
9194
|
-
static void UnaryWindow(Vector inputs[],
|
|
9195
|
-
const FrameBounds &frame, const FrameBounds &prev,
|
|
9194
|
+
static void UnaryWindow(Vector inputs[], const ValidityMask &filter_mask, FunctionData *bind_data,
|
|
9195
|
+
idx_t input_count, data_ptr_t state, const FrameBounds &frame, const FrameBounds &prev,
|
|
9196
|
+
Vector &result, idx_t rid, idx_t bias) {
|
|
9196
9197
|
D_ASSERT(input_count == 1);
|
|
9197
|
-
AggregateExecutor::UnaryWindow<STATE, INPUT_TYPE, RESULT_TYPE, OP>(inputs[0], bind_data, state,
|
|
9198
|
-
result, rid, bias);
|
|
9198
|
+
AggregateExecutor::UnaryWindow<STATE, INPUT_TYPE, RESULT_TYPE, OP>(inputs[0], filter_mask, bind_data, state,
|
|
9199
|
+
frame, prev, result, rid, bias);
|
|
9199
9200
|
}
|
|
9200
9201
|
|
|
9201
9202
|
template <class STATE, class A_TYPE, class B_TYPE, class OP>
|
|
@@ -14363,12 +14364,14 @@ public:
|
|
|
14363
14364
|
string schema;
|
|
14364
14365
|
//! Name of the aggregate function
|
|
14365
14366
|
string function_name;
|
|
14366
|
-
//! The child expression of the main window
|
|
14367
|
+
//! The child expression of the main window function
|
|
14367
14368
|
vector<unique_ptr<ParsedExpression>> children;
|
|
14368
14369
|
//! The set of expressions to partition by
|
|
14369
14370
|
vector<unique_ptr<ParsedExpression>> partitions;
|
|
14370
14371
|
//! The set of ordering clauses
|
|
14371
14372
|
vector<OrderByNode> orders;
|
|
14373
|
+
//! Expression representing a filter, only used for aggregates
|
|
14374
|
+
unique_ptr<ParsedExpression> filter_expr;
|
|
14372
14375
|
//! True to ignore NULL values
|
|
14373
14376
|
bool ignore_nulls;
|
|
14374
14377
|
//! The window boundaries
|
|
@@ -14417,8 +14420,13 @@ public:
|
|
|
14417
14420
|
if (entry.ignore_nulls) {
|
|
14418
14421
|
result += " IGNORE NULLS";
|
|
14419
14422
|
}
|
|
14423
|
+
// FILTER
|
|
14424
|
+
if (entry.filter_expr) {
|
|
14425
|
+
result += ") FILTER (WHERE " + entry.filter_expr->ToString();
|
|
14426
|
+
}
|
|
14427
|
+
|
|
14420
14428
|
// Over clause
|
|
14421
|
-
result += ") OVER(";
|
|
14429
|
+
result += ") OVER (";
|
|
14422
14430
|
string sep;
|
|
14423
14431
|
|
|
14424
14432
|
// Partitions
|
|
@@ -14537,7 +14545,7 @@ public:
|
|
|
14537
14545
|
unique_ptr<AggregateFunction> aggregate;
|
|
14538
14546
|
//! The bound function info
|
|
14539
14547
|
unique_ptr<FunctionData> bind_info;
|
|
14540
|
-
//! The child expressions of the main window
|
|
14548
|
+
//! The child expressions of the main window function
|
|
14541
14549
|
vector<unique_ptr<Expression>> children;
|
|
14542
14550
|
//! The set of expressions to partition by
|
|
14543
14551
|
vector<unique_ptr<Expression>> partitions;
|
|
@@ -14545,6 +14553,8 @@ public:
|
|
|
14545
14553
|
vector<unique_ptr<BaseStatistics>> partitions_stats;
|
|
14546
14554
|
//! The set of ordering clauses
|
|
14547
14555
|
vector<BoundOrderByNode> orders;
|
|
14556
|
+
//! Expression representing a filter, only used for aggregates
|
|
14557
|
+
unique_ptr<Expression> filter_expr;
|
|
14548
14558
|
//! True to ignore NULL values
|
|
14549
14559
|
bool ignore_nulls;
|
|
14550
14560
|
//! The window boundaries
|