duckdb 0.3.3-dev804.0 → 0.3.3-dev821.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.3-dev804.0",
4
+ "version": "0.3.3-dev821.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -4216,7 +4216,7 @@ static DefaultMacro internal_macros[] = {
4216
4216
  {DEFAULT_SCHEMA, "list_prepend", {"e", "l", nullptr}, "list_concat(list_value(e), l)"},
4217
4217
  {DEFAULT_SCHEMA, "array_prepend", {"el", "arr", nullptr}, "list_prepend(el, arr)"},
4218
4218
  {DEFAULT_SCHEMA, "array_pop_back", {"arr", nullptr}, "arr[:LEN(arr)-1]"},
4219
- {DEFAULT_SCHEMA, "array_pop_front", {"arr", nullptr}, "arr[1:]"},
4219
+ {DEFAULT_SCHEMA, "array_pop_front", {"arr", nullptr}, "arr[2:]"},
4220
4220
  {DEFAULT_SCHEMA, "array_push_back", {"arr", "e", nullptr}, "list_concat(arr, list_value(e))"},
4221
4221
  {DEFAULT_SCHEMA, "array_push_front", {"arr", "e", nullptr}, "list_concat(list_value(e), arr)"},
4222
4222
  {DEFAULT_SCHEMA, "generate_subscripts", {"arr", "dim", nullptr}, "unnest(generate_series(1, array_length(arr, dim)))"},
@@ -33139,13 +33139,13 @@ void SetStructMap(DuckDBArrowArrayChildHolder &child_holder, const LogicalType &
33139
33139
  }
33140
33140
 
33141
33141
  struct ArrowUUIDConversion {
33142
- using internal_type_t = uint64_t;
33142
+ using internal_type_t = hugeint_t;
33143
33143
 
33144
33144
  static unique_ptr<Vector> InitializeVector(Vector &data, idx_t size) {
33145
33145
  return make_unique<Vector>(LogicalType::VARCHAR, size);
33146
33146
  }
33147
33147
 
33148
- static idx_t GetStringLength(uint64_t value) {
33148
+ static idx_t GetStringLength(hugeint_t value) {
33149
33149
  return UUID::STRING_SIZE;
33150
33150
  }
33151
33151
 
@@ -33320,7 +33320,7 @@ void SetArrowChild(DuckDBArrowArrayChildHolder &child_holder, const LogicalType
33320
33320
  break;
33321
33321
  }
33322
33322
  case LogicalTypeId::UUID: {
33323
- SetVarchar<ArrowUUIDConversion, uint64_t>(child_holder, type, data, size);
33323
+ SetVarchar<ArrowUUIDConversion, hugeint_t>(child_holder, type, data, size);
33324
33324
  break;
33325
33325
  }
33326
33326
  case LogicalTypeId::LIST: {
@@ -83851,7 +83851,7 @@ static void ExecuteSlice(Vector &result, Vector &s, Vector &b, Vector &e, const
83851
83851
  auto edata = ConstantVector::GetData<INDEX_TYPE>(e);
83852
83852
 
83853
83853
  auto sliced = sdata[0];
83854
- auto begin = bdata[0];
83854
+ auto begin = (bdata[0] > 0) ? bdata[0] - 1 : bdata[0];
83855
83855
  auto end = edata[0];
83856
83856
 
83857
83857
  auto svalid = !ConstantVector::IsNull(s);
@@ -83883,6 +83883,8 @@ static void ExecuteSlice(Vector &result, Vector &s, Vector &b, Vector &e, const
83883
83883
  auto begin = ((INDEX_TYPE *)bdata.data)[bidx];
83884
83884
  auto end = ((INDEX_TYPE *)edata.data)[eidx];
83885
83885
 
83886
+ begin = (begin > 0) ? begin - 1 : begin;
83887
+
83886
83888
  auto svalid = sdata.validity.RowIsValid(sidx);
83887
83889
  auto bvalid = bdata.validity.RowIsValid(bidx);
83888
83890
  auto evalid = edata.validity.RowIsValid(eidx);
@@ -84535,6 +84537,14 @@ void ListExtractTemplate(idx_t count, VectorData &list_data, VectorData &offsets
84535
84537
  if (list_data.validity.RowIsValid(list_index) && offsets_data.validity.RowIsValid(offsets_index)) {
84536
84538
  auto list_entry = ((list_entry_t *)list_data.data)[list_index];
84537
84539
  auto offsets_entry = ((int64_t *)offsets_data.data)[offsets_index];
84540
+
84541
+ // 1-based indexing
84542
+ if (offsets_entry == 0) {
84543
+ result_mask.SetInvalid(i);
84544
+ continue;
84545
+ }
84546
+ offsets_entry = (offsets_entry > 0) ? offsets_entry - 1 : offsets_entry;
84547
+
84538
84548
  idx_t child_offset;
84539
84549
  if (offsets_entry < 0) {
84540
84550
  if ((idx_t)-offsets_entry > list_entry.length) {
@@ -84649,7 +84659,7 @@ static void ExecuteListExtract(Vector &result, Vector &list, Vector &offsets, co
84649
84659
  static void ExecuteStringExtract(Vector &result, Vector &input_vector, Vector &subscript_vector, const idx_t count) {
84650
84660
  BinaryExecutor::Execute<string_t, int32_t, string_t>(
84651
84661
  input_vector, subscript_vector, result, count, [&](string_t input_string, int32_t subscript) {
84652
- return SubstringFun::SubstringScalarFunction(result, input_string, subscript + int32_t(subscript >= 0), 1);
84662
+ return SubstringFun::SubstringScalarFunction(result, input_string, subscript, 1);
84653
84663
  });
84654
84664
  }
84655
84665
 
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 "5588a2c9e"
15
- #define DUCKDB_VERSION "v0.3.3-dev804"
14
+ #define DUCKDB_SOURCE_ID "f36fbb32c"
15
+ #define DUCKDB_VERSION "v0.3.3-dev821"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //