duckdb 0.5.2-dev1246.0 → 0.5.2-dev1249.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
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.5.2-dev1246.0",
5
+ "version": "0.5.2-dev1249.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -119528,6 +119528,7 @@ struct ArrowScanLocalState : public LocalTableFunctionState {
119528
119528
  unique_ptr<ArrowArrayStreamWrapper> stream;
119529
119529
  shared_ptr<ArrowArrayWrapper> chunk;
119530
119530
  idx_t chunk_offset = 0;
119531
+ idx_t batch_index = 0;
119531
119532
  vector<column_t> column_ids;
119532
119533
  //! Store child vectors for Arrow Dictionary Vectors (col-idx,vector)
119533
119534
  unordered_map<idx_t, unique_ptr<Vector>> arrow_dictionary_vectors;
@@ -119540,6 +119541,7 @@ struct ArrowScanGlobalState : public GlobalTableFunctionState {
119540
119541
  unique_ptr<ArrowArrayStreamWrapper> stream;
119541
119542
  mutex main_mutex;
119542
119543
  idx_t max_threads = 1;
119544
+ idx_t batch_index = 0;
119543
119545
  bool done = false;
119544
119546
 
119545
119547
  vector<idx_t> projection_ids;
@@ -119839,6 +119841,7 @@ bool ArrowScanParallelStateNext(ClientContext &context, const FunctionData *bind
119839
119841
  return false;
119840
119842
  }
119841
119843
  state.chunk_offset = 0;
119844
+ state.batch_index = ++parallel_state.batch_index;
119842
119845
 
119843
119846
  auto current_chunk = parallel_state.stream->GetNextChunk();
119844
119847
  while (current_chunk->arrow_array.length == 0 && current_chunk->arrow_array.release) {
@@ -119924,10 +119927,17 @@ unique_ptr<NodeStatistics> ArrowTableFunction::ArrowScanCardinality(ClientContex
119924
119927
  return make_unique<NodeStatistics>();
119925
119928
  }
119926
119929
 
119930
+ idx_t ArrowGetBatchIndex(ClientContext &context, const FunctionData *bind_data_p, LocalTableFunctionState *local_state,
119931
+ GlobalTableFunctionState *global_state) {
119932
+ auto &state = (ArrowScanLocalState &)*local_state;
119933
+ return state.batch_index;
119934
+ }
119935
+
119927
119936
  void ArrowTableFunction::RegisterFunction(BuiltinFunctions &set) {
119928
119937
  TableFunction arrow("arrow_scan", {LogicalType::POINTER, LogicalType::POINTER, LogicalType::POINTER},
119929
119938
  ArrowScanFunction, ArrowScanBind, ArrowScanInitGlobal, ArrowScanInitLocal);
119930
119939
  arrow.cardinality = ArrowScanCardinality;
119940
+ arrow.get_batch_index = ArrowGetBatchIndex;
119931
119941
  arrow.projection_pushdown = true;
119932
119942
  arrow.filter_pushdown = true;
119933
119943
  arrow.filter_prune = true;
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 "bf995526f"
15
- #define DUCKDB_VERSION "v0.5.2-dev1246"
14
+ #define DUCKDB_SOURCE_ID "550e8ef74"
15
+ #define DUCKDB_VERSION "v0.5.2-dev1249"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //