duckdb 0.3.2-dev741.0 → 0.3.2-dev784.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.2-dev741.0",
4
+ "version": "0.3.2-dev784.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -27591,8 +27591,6 @@ public:
27591
27591
  private:
27592
27592
  unique_ptr<TreeNode> CreateTree(PhysicalOperator *root, idx_t depth = 0);
27593
27593
  void Render(const TreeNode &node, std::ostream &str) const;
27594
- //! The lock used for flushing information from a thread into the global query profiler
27595
- mutex flush_lock;
27596
27594
 
27597
27595
  public:
27598
27596
  DUCKDB_API bool IsEnabled() const;
@@ -27633,6 +27631,8 @@ private:
27633
27631
 
27634
27632
  //! Whether or not the query profiler is running
27635
27633
  bool running;
27634
+ //! The lock used for flushing information from a thread into the global query profiler
27635
+ mutex flush_lock;
27636
27636
 
27637
27637
  //! Whether or not the query requires profiling
27638
27638
  bool query_requires_profiling;
@@ -27645,7 +27645,7 @@ private:
27645
27645
  Profiler main_query;
27646
27646
  //! A map of a Physical Operator pointer to a tree node
27647
27647
  TreeMap tree_map;
27648
-
27648
+ //! Whether or not we are running as part of a explain_analyze query
27649
27649
  bool is_explain_analyze;
27650
27650
 
27651
27651
  public:
@@ -27675,12 +27675,12 @@ private:
27675
27675
  class QueryProfilerHistory {
27676
27676
  private:
27677
27677
  //! Previous Query profilers
27678
- deque<pair<transaction_t, unique_ptr<QueryProfiler>>> prev_profilers;
27678
+ deque<pair<transaction_t, shared_ptr<QueryProfiler>>> prev_profilers;
27679
27679
  //! Previous Query profilers size
27680
27680
  uint64_t prev_profilers_size = 20;
27681
27681
 
27682
27682
  public:
27683
- deque<pair<transaction_t, unique_ptr<QueryProfiler>>> &GetPrevProfilers() {
27683
+ deque<pair<transaction_t, shared_ptr<QueryProfiler>>> &GetPrevProfilers() {
27684
27684
  return prev_profilers;
27685
27685
  }
27686
27686
  QueryProfilerHistory() {
@@ -33840,13 +33840,14 @@ void ValidityMask::Slice(const ValidityMask &other, idx_t offset) {
33840
33840
  Initialize(other);
33841
33841
  return;
33842
33842
  }
33843
- Initialize(STANDARD_VECTOR_SIZE);
33843
+ ValidityMask new_mask(STANDARD_VECTOR_SIZE);
33844
33844
 
33845
33845
  // FIXME THIS NEEDS FIXING!
33846
33846
  #if 1
33847
33847
  for (idx_t i = offset; i < STANDARD_VECTOR_SIZE; i++) {
33848
- Set(i - offset, other.RowIsValid(i));
33848
+ new_mask.Set(i - offset, other.RowIsValid(i));
33849
33849
  }
33850
+ Initialize(new_mask);
33850
33851
  #else
33851
33852
  // first shift the "whole" units
33852
33853
  idx_t entire_units = offset / BITS_PER_VALUE;
@@ -33854,7 +33855,7 @@ void ValidityMask::Slice(const ValidityMask &other, idx_t offset) {
33854
33855
  if (entire_units > 0) {
33855
33856
  idx_t validity_idx;
33856
33857
  for (validity_idx = 0; validity_idx + entire_units < STANDARD_ENTRY_COUNT; validity_idx++) {
33857
- validity_mask[validity_idx] = other.validity_mask[validity_idx + entire_units];
33858
+ new_mask.validity_mask[validity_idx] = other.validity_mask[validity_idx + entire_units];
33858
33859
  }
33859
33860
  }
33860
33861
  // now we shift the remaining sub units
@@ -33869,15 +33870,17 @@ void ValidityMask::Slice(const ValidityMask &other, idx_t offset) {
33869
33870
  if (sub_units > 0) {
33870
33871
  idx_t validity_idx;
33871
33872
  for (validity_idx = 0; validity_idx + 1 < STANDARD_ENTRY_COUNT; validity_idx++) {
33872
- validity_mask[validity_idx] = (other.validity_mask[validity_idx] >> sub_units) |
33873
- (other.validity_mask[validity_idx + 1] << (BITS_PER_VALUE - sub_units));
33873
+ new_mask.validity_mask[validity_idx] =
33874
+ (other.validity_mask[validity_idx] >> sub_units) |
33875
+ (other.validity_mask[validity_idx + 1] << (BITS_PER_VALUE - sub_units));
33874
33876
  }
33875
- validity_mask[validity_idx] >>= sub_units;
33877
+ new_mask.validity_mask[validity_idx] >>= sub_units;
33876
33878
  }
33877
33879
  #ifdef DEBUG
33878
33880
  for (idx_t i = offset; i < STANDARD_VECTOR_SIZE; i++) {
33879
- D_ASSERT(RowIsValid(i - offset) == other.RowIsValid(i));
33881
+ D_ASSERT(new_mask.RowIsValid(i - offset) == other.RowIsValid(i));
33880
33882
  }
33883
+ Initialize(new_mask);
33881
33884
  #endif
33882
33885
  #endif
33883
33886
  }
@@ -74464,7 +74467,8 @@ string MacroFunction::ValidateArguments(MacroCatalogEntry &macro_func, FunctionE
74464
74467
  } else if (defaults.find(arg->alias) != defaults.end()) {
74465
74468
  return StringUtil::Format("Duplicate default parameters %s!", arg->alias);
74466
74469
  }
74467
- defaults[arg->alias] = move(arg);
74470
+ auto alias = arg->alias;
74471
+ defaults[alias] = move(arg);
74468
74472
  } else if (!defaults.empty()) {
74469
74473
  return "Positional parameters cannot come after parameters with a default value!";
74470
74474
  } else {
@@ -97524,7 +97528,7 @@ struct ActiveQueryContext {
97524
97528
  };
97525
97529
 
97526
97530
  ClientContext::ClientContext(shared_ptr<DatabaseInstance> database)
97527
- : profiler(make_unique<QueryProfiler>(*this)), query_profiler_history(make_unique<QueryProfilerHistory>()),
97531
+ : profiler(make_shared<QueryProfiler>(*this)), query_profiler_history(make_unique<QueryProfilerHistory>()),
97528
97532
  db(move(database)), transaction(db->GetTransactionManager(), *this), interrupted(false),
97529
97533
  temporary_objects(make_unique<SchemaCatalogEntry>(&db->GetCatalog(), TEMP_SCHEMA, true)),
97530
97534
  catalog_search_path(make_unique<CatalogSearchPath>(*this)),
@@ -97619,7 +97623,7 @@ string ClientContext::EndQueryInternal(ClientContextLock &lock, bool success, bo
97619
97623
  auto &prev_profilers = query_profiler_history->GetPrevProfilers();
97620
97624
  prev_profilers.emplace_back(transaction.ActiveTransaction().active_query, move(profiler));
97621
97625
  // Reinitialize the query profiler
97622
- profiler = make_unique<QueryProfiler>(*this);
97626
+ profiler = make_shared<QueryProfiler>(*this);
97623
97627
  // Propagate settings of the saved query into the new profiler.
97624
97628
  profiler->Propagate(*prev_profilers.back().second);
97625
97629
  if (prev_profilers.size() >= query_profiler_history->GetPrevProfilersSize()) {
@@ -99881,6 +99885,7 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
99881
99885
 
99882
99886
 
99883
99887
 
99888
+ #ifndef DISABLE_DUCKDB_REMOTE_INSTALL
99884
99889
 
99885
99890
 
99886
99891
  // LICENSE_CHANGE_BEGIN
@@ -107323,6 +107328,7 @@ inline SSL_CTX *Client::ssl_context() const {
107323
107328
 
107324
107329
  // LICENSE_CHANGE_END
107325
107330
 
107331
+ #endif
107326
107332
 
107327
107333
 
107328
107334
  #include <fstream>
@@ -107380,6 +107386,9 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
107380
107386
  throw IOException("Failed to read extension from \"%s\": no such file", extension);
107381
107387
  }
107382
107388
 
107389
+ #ifdef DISABLE_DUCKDB_REMOTE_INSTALL
107390
+ throw BinderException("Remote extension installation is disabled through configuration");
107391
+ #else
107383
107392
  string url_template = "http://extensions.duckdb.org/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension.gz";
107384
107393
 
107385
107394
  if (is_http_url) {
@@ -107418,6 +107427,7 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
107418
107427
  if (out.bad()) {
107419
107428
  throw IOException("Failed to write extension to %s", local_extension_path);
107420
107429
  }
107430
+ #endif
107421
107431
  }
107422
107432
 
107423
107433
  } // namespace duckdb
@@ -107895,6 +107905,7 @@ void QueryProfiler::StartExplainAnalyze() {
107895
107905
  }
107896
107906
 
107897
107907
  void QueryProfiler::EndQuery() {
107908
+ lock_guard<mutex> guard(flush_lock);
107898
107909
  if (!IsEnabled() || !running) {
107899
107910
  return;
107900
107911
  }
@@ -108053,10 +108064,10 @@ void OperatorProfiler::Flush(const PhysicalOperator *phys_op, ExpressionExecutor
108053
108064
  }
108054
108065
 
108055
108066
  void QueryProfiler::Flush(OperatorProfiler &profiler) {
108067
+ lock_guard<mutex> guard(flush_lock);
108056
108068
  if (!IsEnabled() || !running) {
108057
108069
  return;
108058
108070
  }
108059
- lock_guard<mutex> guard(flush_lock);
108060
108071
  for (auto &node : profiler.timings) {
108061
108072
  auto entry = tree_map.find(node.first);
108062
108073
  D_ASSERT(entry != tree_map.end());
@@ -120731,8 +120742,8 @@ void Executor::Initialize(PhysicalOperator *plan) {
120731
120742
  lock_guard<mutex> elock(executor_lock);
120732
120743
  physical_plan = plan;
120733
120744
 
120734
- auto &profiler = QueryProfiler::Get(context);
120735
- profiler.Initialize(physical_plan);
120745
+ this->profiler = context.profiler;
120746
+ profiler->Initialize(physical_plan);
120736
120747
  this->producer = scheduler.CreateProducer();
120737
120748
 
120738
120749
  auto root_pipeline = make_shared<Pipeline>(*this);
@@ -121143,9 +121154,7 @@ void Executor::ThrowExceptionInternal() { // LCOV_EXCL_START
121143
121154
  } // LCOV_EXCL_STOP
121144
121155
 
121145
121156
  void Executor::Flush(ThreadContext &tcontext) {
121146
- lock_guard<mutex> elock(executor_lock);
121147
- auto &profiler = QueryProfiler::Get(context);
121148
- profiler.Flush(tcontext.profiler);
121157
+ profiler->Flush(tcontext.profiler);
121149
121158
  }
121150
121159
 
121151
121160
  bool Executor::GetPipelinesProgress(double &current_progress) { // LCOV_EXCL_START
@@ -138756,7 +138765,8 @@ unique_ptr<CreateStatement> Transformer::TransformCreateFunction(duckdb_libpgque
138756
138765
  if (macro_func->default_parameters.find(param->alias) != macro_func->default_parameters.end()) {
138757
138766
  throw ParserException("Duplicate default parameter: '%s'", param->alias);
138758
138767
  }
138759
- macro_func->default_parameters[param->alias] = move(param);
138768
+ auto alias = param->alias;
138769
+ macro_func->default_parameters[alias] = move(param);
138760
138770
  } else if (param->GetExpressionClass() == ExpressionClass::COLUMN_REF) {
138761
138771
  // positional parameters
138762
138772
  if (!macro_func->default_parameters.empty()) {
@@ -153713,6 +153723,7 @@ void __fastpack64(const uint64_t *__restrict in, uint32_t *__restrict out);
153713
153723
  // LICENSE_CHANGE_END
153714
153724
 
153715
153725
 
153726
+
153716
153727
  #include <stdexcept>
153717
153728
 
153718
153729
  namespace duckdb_fastpforlib {
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 "3a66c6b20"
15
- #define DUCKDB_VERSION "0.3.2-dev741"
14
+ #define DUCKDB_SOURCE_ID "f338ea423"
15
+ #define DUCKDB_VERSION "0.3.2-dev784"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -9869,6 +9869,7 @@ class DataChunk;
9869
9869
  class PhysicalOperator;
9870
9870
  class PipelineExecutor;
9871
9871
  class OperatorState;
9872
+ class QueryProfiler;
9872
9873
  class ThreadContext;
9873
9874
  class Task;
9874
9875
 
@@ -9968,6 +9969,8 @@ private:
9968
9969
  vector<pair<ExceptionType, string>> exceptions;
9969
9970
  //! List of events
9970
9971
  vector<shared_ptr<Event>> events;
9972
+ //! The query profiler
9973
+ shared_ptr<QueryProfiler> profiler;
9971
9974
 
9972
9975
  //! The amount of completed pipelines of the query
9973
9976
  atomic<idx_t> completed_pipelines;
@@ -17117,7 +17120,7 @@ public:
17117
17120
  DUCKDB_API ~ClientContext();
17118
17121
 
17119
17122
  //! Query profiler
17120
- unique_ptr<QueryProfiler> profiler;
17123
+ shared_ptr<QueryProfiler> profiler;
17121
17124
  //! QueryProfiler History
17122
17125
  unique_ptr<QueryProfilerHistory> query_profiler_history;
17123
17126
  //! The database that this client is connected to