duckdb 0.3.5-dev658.0 → 0.3.5-dev668.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.3.5-dev658.0",
4
+ "version": "0.3.5-dev668.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -1261,7 +1261,7 @@ public:
1261
1261
  }
1262
1262
 
1263
1263
  template <class T, class RETURN_TYPE = unique_ptr<T>, typename... ARGS>
1264
- RETURN_TYPE ReadSerializable(RETURN_TYPE default_value, ARGS &&...args) {
1264
+ RETURN_TYPE ReadSerializable(RETURN_TYPE default_value, ARGS &&... args) {
1265
1265
  if (field_count >= max_field_count) {
1266
1266
  // field is not there, read the default value
1267
1267
  return default_value;
@@ -1283,7 +1283,7 @@ public:
1283
1283
  }
1284
1284
 
1285
1285
  template <class T, class RETURN_TYPE = unique_ptr<T>, typename... ARGS>
1286
- RETURN_TYPE ReadRequiredSerializable(ARGS &&...args) {
1286
+ RETURN_TYPE ReadRequiredSerializable(ARGS &&... args) {
1287
1287
  if (field_count >= max_field_count) {
1288
1288
  // field is not there, read the default value
1289
1289
  throw SerializationException("Attempting to read mandatory field, but field is missing");
@@ -52758,28 +52758,23 @@ idx_t GroupedAggregateHashTable::AddChunk(DataChunk &groups, Vector &group_hashe
52758
52758
  // value have not been seen yet
52759
52759
  idx_t new_group_count =
52760
52760
  distinct_hashes[aggr_idx]->FindOrCreateGroups(probe_chunk, dummy_addresses, new_groups);
52761
-
52762
- // now fix up the payload and addresses accordingly by creating
52763
- // a selection vector
52764
52761
  if (new_group_count > 0) {
52762
+ // now fix up the payload and addresses accordingly by creating
52763
+ // a selection vector
52764
+ DataChunk distinct_payload;
52765
+ distinct_payload.Initialize(payload.GetTypes());
52766
+ distinct_payload.Slice(payload, new_groups, new_group_count);
52767
+ distinct_payload.Verify();
52768
+
52769
+ Vector distinct_addresses(addresses, new_groups, new_group_count);
52770
+ distinct_addresses.Verify(new_group_count);
52771
+
52765
52772
  if (aggr.filter) {
52766
- Vector distinct_addresses(addresses, new_groups, new_group_count);
52767
- DataChunk distinct_payload;
52768
- auto pay_types = payload.GetTypes();
52769
- distinct_payload.Initialize(pay_types);
52770
- distinct_payload.Slice(payload, new_groups, new_group_count);
52771
- distinct_addresses.Verify(new_group_count);
52772
52773
  distinct_addresses.Normalify(new_group_count);
52773
52774
  RowOperations::UpdateFilteredStates(aggr, distinct_addresses, distinct_payload, payload_idx);
52774
52775
  } else {
52775
- Vector distinct_addresses(addresses, new_groups, new_group_count);
52776
- for (idx_t i = 0; i < aggr.child_count; i++) {
52777
- payload.data[payload_idx + i].Slice(new_groups, new_group_count);
52778
- payload.data[payload_idx + i].Verify(new_group_count);
52779
- }
52780
- distinct_addresses.Verify(new_group_count);
52781
-
52782
- RowOperations::UpdateStates(aggr, distinct_addresses, payload, payload_idx, new_group_count);
52776
+ RowOperations::UpdateStates(aggr, distinct_addresses, distinct_payload, payload_idx,
52777
+ new_group_count);
52783
52778
  }
52784
52779
  }
52785
52780
  } else if (aggr.filter) {
@@ -58033,6 +58028,7 @@ SinkResultType PhysicalHashAggregate::Sink(ExecutionContext &context, GlobalSink
58033
58028
  for (auto &child_expr : aggr.children) {
58034
58029
  D_ASSERT(child_expr->type == ExpressionType::BOUND_REF);
58035
58030
  auto &bound_ref_expr = (BoundReferenceExpression &)*child_expr;
58031
+ D_ASSERT(bound_ref_expr.index < input.data.size());
58036
58032
  aggregate_input_chunk.data[aggregate_input_idx++].Reference(input.data[bound_ref_expr.index]);
58037
58033
  }
58038
58034
  }
@@ -58041,6 +58037,7 @@ SinkResultType PhysicalHashAggregate::Sink(ExecutionContext &context, GlobalSink
58041
58037
  if (aggr.filter) {
58042
58038
  auto it = filter_indexes.find(aggr.filter.get());
58043
58039
  D_ASSERT(it != filter_indexes.end());
58040
+ D_ASSERT(it->second < input.data.size());
58044
58041
  aggregate_input_chunk.data[aggregate_input_idx++].Reference(input.data[it->second]);
58045
58042
  }
58046
58043
  }
@@ -105057,6 +105054,14 @@ void ColumnArrowToDuckDB(Vector &vector, ArrowArray &array, ArrowScanState &scan
105057
105054
  auto &struct_validity_mask = FlatVector::Validity(vector);
105058
105055
  for (idx_t type_idx = 0; type_idx < (idx_t)array.n_children; type_idx++) {
105059
105056
  SetValidityMask(*child_entries[type_idx], *array.children[type_idx], scan_state, size, nested_offset);
105057
+ if (!struct_validity_mask.AllValid()) {
105058
+ auto &child_validity_mark = FlatVector::Validity(*child_entries[type_idx]);
105059
+ for (idx_t i = 0; i < size; i++) {
105060
+ if (!struct_validity_mask.RowIsValid(i)) {
105061
+ child_validity_mark.SetInvalid(i);
105062
+ }
105063
+ }
105064
+ }
105060
105065
  ColumnArrowToDuckDB(*child_entries[type_idx], *array.children[type_idx], scan_state, size,
105061
105066
  arrow_convert_data, col_idx, arrow_convert_idx, nested_offset, &struct_validity_mask);
105062
105067
  }
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 "1d0e9975a"
15
- #define DUCKDB_VERSION "v0.3.5-dev658"
14
+ #define DUCKDB_SOURCE_ID "8526d4ff6"
15
+ #define DUCKDB_VERSION "v0.3.5-dev668"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //