duckdb 0.4.1-dev344.0 → 0.4.1-dev347.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.4.1-dev344.0",
4
+ "version": "0.4.1-dev347.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -60105,14 +60105,21 @@ public:
60105
60105
  StreamingWindowState() : initialized(false) {
60106
60106
  }
60107
60107
 
60108
- void Initialize(DataChunk &input, const vector<unique_ptr<Expression>> &expressions) {
60108
+ void Initialize(Allocator &allocator, DataChunk &input, const vector<unique_ptr<Expression>> &expressions) {
60109
60109
  for (idx_t expr_idx = 0; expr_idx < expressions.size(); expr_idx++) {
60110
60110
  auto &expr = *expressions[expr_idx];
60111
60111
  switch (expr.GetExpressionType()) {
60112
60112
  case ExpressionType::WINDOW_FIRST_VALUE: {
60113
60113
  auto &wexpr = (BoundWindowExpression &)expr;
60114
- auto &ref = (BoundReferenceExpression &)*wexpr.children[0];
60115
- const_vectors.push_back(make_unique<Vector>(input.data[ref.index].GetValue(0)));
60114
+
60115
+ // Just execute the expression once
60116
+ ExpressionExecutor executor(allocator);
60117
+ executor.AddExpression(*wexpr.children[0]);
60118
+ DataChunk result;
60119
+ result.Initialize(allocator, {wexpr.children[0]->return_type});
60120
+ executor.Execute(input, result);
60121
+
60122
+ const_vectors.push_back(make_unique<Vector>(result.GetValue(0, 0)));
60116
60123
  break;
60117
60124
  }
60118
60125
  case ExpressionType::WINDOW_PERCENT_RANK: {
@@ -60149,7 +60156,8 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D
60149
60156
  auto &gstate = (StreamingWindowGlobalState &)gstate_p;
60150
60157
  auto &state = (StreamingWindowState &)state_p;
60151
60158
  if (!state.initialized) {
60152
- state.Initialize(input, select_list);
60159
+ auto &allocator = Allocator::Get(context.client);
60160
+ state.Initialize(allocator, input, select_list);
60153
60161
  }
60154
60162
  // Put payload columns in place
60155
60163
  for (idx_t col_idx = 0; col_idx < input.data.size(); col_idx++) {
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 "001284c09"
15
- #define DUCKDB_VERSION "v0.4.1-dev344"
14
+ #define DUCKDB_SOURCE_ID "81c2ea292"
15
+ #define DUCKDB_VERSION "v0.4.1-dev347"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //