duckdb 0.3.4-dev7.0 → 0.3.4-dev70.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.4-dev7.0",
4
+ "version": "0.3.4-dev70.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -68361,12 +68361,12 @@ void PartitionableHashTable::Partition() {
68361
68361
  D_ASSERT(radix_partitioned_hts.size() == 0);
68362
68362
  D_ASSERT(partition_info.n_partitions > 1);
68363
68363
 
68364
- vector<GroupedAggregateHashTable *> partition_hts;
68364
+ vector<GroupedAggregateHashTable *> partition_hts(partition_info.n_partitions);
68365
68365
  for (auto &unpartitioned_ht : unpartitioned_hts) {
68366
68366
  for (idx_t r = 0; r < partition_info.n_partitions; r++) {
68367
68367
  radix_partitioned_hts[r].push_back(make_unique<GroupedAggregateHashTable>(
68368
68368
  buffer_manager, group_types, payload_types, bindings, HtEntryType::HT_WIDTH_32));
68369
- partition_hts.push_back(radix_partitioned_hts[r].back().get());
68369
+ partition_hts[r] = radix_partitioned_hts[r].back().get();
68370
68370
  }
68371
68371
  unpartitioned_ht->Partition(partition_hts, partition_info.radix_mask, partition_info.RADIX_SHIFT);
68372
68372
  unpartitioned_ht.reset();
@@ -80015,6 +80015,9 @@ void HistogramFun::RegisterFunction(BuiltinFunctions &set) {
80015
80015
  fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_S));
80016
80016
  fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_MS));
80017
80017
  fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_NS));
80018
+ fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIME));
80019
+ fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIME_TZ));
80020
+ fun.AddFunction(GetHistogramFunction<int32_t>(LogicalType::DATE));
80018
80021
  set.AddFunction(fun);
80019
80022
  }
80020
80023
 
@@ -88274,10 +88277,7 @@ static void ListAggregateFunction(DataChunk &args, ExpressionState &state, Vecto
88274
88277
  continue;
88275
88278
  }
88276
88279
 
88277
- auto source_idx = child_data.sel->get_index(list_entry.offset);
88278
- idx_t child_idx = 0;
88279
-
88280
- while (child_idx < list_entry.length) {
88280
+ for (idx_t child_idx = 0; child_idx < list_entry.length; child_idx++) {
88281
88281
 
88282
88282
  // states vector is full, update
88283
88283
  if (states_idx == STANDARD_VECTOR_SIZE) {
@@ -88290,10 +88290,10 @@ static void ListAggregateFunction(DataChunk &args, ExpressionState &state, Vecto
88290
88290
  states_idx = 0;
88291
88291
  }
88292
88292
 
88293
- sel_vector.set_index(states_idx, source_idx + child_idx);
88293
+ auto source_idx = child_data.sel->get_index(list_entry.offset + child_idx);
88294
+ sel_vector.set_index(states_idx, source_idx);
88294
88295
  states_update[states_idx] = state_ptr;
88295
88296
  states_idx++;
88296
- child_idx++;
88297
88297
  }
88298
88298
  }
88299
88299
 
@@ -88330,7 +88330,7 @@ static unique_ptr<FunctionData> ListAggregateBind(ClientContext &context, Scalar
88330
88330
 
88331
88331
  // get the function name
88332
88332
  Value function_value = ExpressionExecutor::EvaluateScalar(*arguments[1]);
88333
- auto function_name = StringValue::Get(function_value);
88333
+ auto function_name = function_value.ToString();
88334
88334
 
88335
88335
  vector<LogicalType> types;
88336
88336
  types.push_back(list_child_type);
@@ -170302,6 +170302,10 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co
170302
170302
  D_ASSERT(removed_column < column_definitions.size());
170303
170303
  column_definitions.erase(column_definitions.begin() + removed_column);
170304
170304
 
170305
+ for (idx_t i = 0; i < column_definitions.size(); i++) {
170306
+ column_definitions[i].oid = i;
170307
+ }
170308
+
170305
170309
  // alter the row_groups and remove the column from each of them
170306
170310
  this->row_groups = make_shared<SegmentTree>();
170307
170311
  auto current_row_group = (RowGroup *)parent.row_groups->GetRootSegment();
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 "dd74d9dde"
15
- #define DUCKDB_VERSION "v0.3.4-dev7"
14
+ #define DUCKDB_SOURCE_ID "f63df22eb"
15
+ #define DUCKDB_VERSION "v0.3.4-dev70"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -2473,6 +2473,13 @@ public:
2473
2473
  entry_idx = row_idx / BITS_PER_VALUE;
2474
2474
  idx_in_entry = row_idx % BITS_PER_VALUE;
2475
2475
  }
2476
+ //! Get an entry that has first-n bits set as valid and rest set as invalid
2477
+ static inline V EntryWithValidBits(idx_t n) {
2478
+ if (n == 0) {
2479
+ return V(0);
2480
+ }
2481
+ return ValidityBuffer::MAX_ENTRY >> (BITS_PER_VALUE - n);
2482
+ }
2476
2483
 
2477
2484
  //! RowIsValidUnsafe should only be used if AllValid() is false: it achieves the same as RowIsValid but skips a
2478
2485
  //! not-null check
@@ -2548,20 +2555,33 @@ public:
2548
2555
  }
2549
2556
  }
2550
2557
 
2551
- //! Marks "count" entries in the validity mask as invalid (null)
2558
+ //! Marks exactly "count" bits in the validity mask as invalid (null)
2552
2559
  inline void SetAllInvalid(idx_t count) {
2553
2560
  EnsureWritable();
2554
- for (idx_t i = 0; i < ValidityBuffer::EntryCount(count); i++) {
2561
+ if (count == 0) {
2562
+ return;
2563
+ }
2564
+ auto last_entry_index = ValidityBuffer::EntryCount(count) - 1;
2565
+ for (idx_t i = 0; i < last_entry_index; i++) {
2555
2566
  validity_mask[i] = 0;
2556
2567
  }
2568
+ auto last_entry_bits = count % static_cast<idx_t>(BITS_PER_VALUE);
2569
+ validity_mask[last_entry_index] = (last_entry_bits == 0) ? 0 : (ValidityBuffer::MAX_ENTRY << (last_entry_bits));
2557
2570
  }
2558
2571
 
2559
- //! Marks "count" entries in the validity mask as valid (not null)
2572
+ //! Marks exactly "count" bits in the validity mask as valid (not null)
2560
2573
  inline void SetAllValid(idx_t count) {
2561
2574
  EnsureWritable();
2562
- for (idx_t i = 0; i < ValidityBuffer::EntryCount(count); i++) {
2575
+ if (count == 0) {
2576
+ return;
2577
+ }
2578
+ auto last_entry_index = ValidityBuffer::EntryCount(count) - 1;
2579
+ for (idx_t i = 0; i < last_entry_index; i++) {
2563
2580
  validity_mask[i] = ValidityBuffer::MAX_ENTRY;
2564
2581
  }
2582
+ auto last_entry_bits = count % static_cast<idx_t>(BITS_PER_VALUE);
2583
+ validity_mask[last_entry_index] |=
2584
+ (last_entry_bits == 0) ? ValidityBuffer::MAX_ENTRY : ~(ValidityBuffer::MAX_ENTRY << (last_entry_bits));
2565
2585
  }
2566
2586
 
2567
2587
  inline bool IsMaskSet() const {