duckdb 0.3.2-dev772.0 → 0.3.2-dev788.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 +1 -1
- package/src/duckdb.cpp +35 -15
- package/src/duckdb.hpp +11 -3
- package/src/parquet-amalgamation.cpp +34854 -34749
- package/src/parquet-amalgamation.hpp +3 -2
package/package.json
CHANGED
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,
|
|
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,
|
|
27683
|
+
deque<pair<transaction_t, shared_ptr<QueryProfiler>>> &GetPrevProfilers() {
|
|
27684
27684
|
return prev_profilers;
|
|
27685
27685
|
}
|
|
27686
27686
|
QueryProfilerHistory() {
|
|
@@ -38204,6 +38204,9 @@ LogicalType LogicalType::STRUCT(child_list_t<LogicalType> children) {
|
|
|
38204
38204
|
return LogicalType(LogicalTypeId::STRUCT, move(info));
|
|
38205
38205
|
}
|
|
38206
38206
|
|
|
38207
|
+
//===--------------------------------------------------------------------===//
|
|
38208
|
+
// Map Type
|
|
38209
|
+
//===--------------------------------------------------------------------===//
|
|
38207
38210
|
LogicalType LogicalType::MAP(child_list_t<LogicalType> children) {
|
|
38208
38211
|
auto info = make_shared<StructTypeInfo>(move(children));
|
|
38209
38212
|
return LogicalType(LogicalTypeId::MAP, move(info));
|
|
@@ -38216,6 +38219,16 @@ LogicalType LogicalType::MAP(LogicalType key, LogicalType value) {
|
|
|
38216
38219
|
return LogicalType::MAP(move(child_types));
|
|
38217
38220
|
}
|
|
38218
38221
|
|
|
38222
|
+
const LogicalType &MapType::KeyType(const LogicalType &type) {
|
|
38223
|
+
D_ASSERT(type.id() == LogicalTypeId::MAP);
|
|
38224
|
+
return StructType::GetChildTypes(type)[0].second;
|
|
38225
|
+
}
|
|
38226
|
+
|
|
38227
|
+
const LogicalType &MapType::ValueType(const LogicalType &type) {
|
|
38228
|
+
D_ASSERT(type.id() == LogicalTypeId::MAP);
|
|
38229
|
+
return StructType::GetChildTypes(type)[1].second;
|
|
38230
|
+
}
|
|
38231
|
+
|
|
38219
38232
|
//===--------------------------------------------------------------------===//
|
|
38220
38233
|
// User Type
|
|
38221
38234
|
//===--------------------------------------------------------------------===//
|
|
@@ -74467,7 +74480,8 @@ string MacroFunction::ValidateArguments(MacroCatalogEntry ¯o_func, FunctionE
|
|
|
74467
74480
|
} else if (defaults.find(arg->alias) != defaults.end()) {
|
|
74468
74481
|
return StringUtil::Format("Duplicate default parameters %s!", arg->alias);
|
|
74469
74482
|
}
|
|
74470
|
-
|
|
74483
|
+
auto alias = arg->alias;
|
|
74484
|
+
defaults[alias] = move(arg);
|
|
74471
74485
|
} else if (!defaults.empty()) {
|
|
74472
74486
|
return "Positional parameters cannot come after parameters with a default value!";
|
|
74473
74487
|
} else {
|
|
@@ -97527,7 +97541,7 @@ struct ActiveQueryContext {
|
|
|
97527
97541
|
};
|
|
97528
97542
|
|
|
97529
97543
|
ClientContext::ClientContext(shared_ptr<DatabaseInstance> database)
|
|
97530
|
-
: profiler(
|
|
97544
|
+
: profiler(make_shared<QueryProfiler>(*this)), query_profiler_history(make_unique<QueryProfilerHistory>()),
|
|
97531
97545
|
db(move(database)), transaction(db->GetTransactionManager(), *this), interrupted(false),
|
|
97532
97546
|
temporary_objects(make_unique<SchemaCatalogEntry>(&db->GetCatalog(), TEMP_SCHEMA, true)),
|
|
97533
97547
|
catalog_search_path(make_unique<CatalogSearchPath>(*this)),
|
|
@@ -97622,7 +97636,7 @@ string ClientContext::EndQueryInternal(ClientContextLock &lock, bool success, bo
|
|
|
97622
97636
|
auto &prev_profilers = query_profiler_history->GetPrevProfilers();
|
|
97623
97637
|
prev_profilers.emplace_back(transaction.ActiveTransaction().active_query, move(profiler));
|
|
97624
97638
|
// Reinitialize the query profiler
|
|
97625
|
-
profiler =
|
|
97639
|
+
profiler = make_shared<QueryProfiler>(*this);
|
|
97626
97640
|
// Propagate settings of the saved query into the new profiler.
|
|
97627
97641
|
profiler->Propagate(*prev_profilers.back().second);
|
|
97628
97642
|
if (prev_profilers.size() >= query_profiler_history->GetPrevProfilersSize()) {
|
|
@@ -99884,6 +99898,7 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
|
|
|
99884
99898
|
|
|
99885
99899
|
|
|
99886
99900
|
|
|
99901
|
+
#ifndef DISABLE_DUCKDB_REMOTE_INSTALL
|
|
99887
99902
|
|
|
99888
99903
|
|
|
99889
99904
|
// LICENSE_CHANGE_BEGIN
|
|
@@ -107326,6 +107341,7 @@ inline SSL_CTX *Client::ssl_context() const {
|
|
|
107326
107341
|
|
|
107327
107342
|
// LICENSE_CHANGE_END
|
|
107328
107343
|
|
|
107344
|
+
#endif
|
|
107329
107345
|
|
|
107330
107346
|
|
|
107331
107347
|
#include <fstream>
|
|
@@ -107383,6 +107399,9 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
|
|
|
107383
107399
|
throw IOException("Failed to read extension from \"%s\": no such file", extension);
|
|
107384
107400
|
}
|
|
107385
107401
|
|
|
107402
|
+
#ifdef DISABLE_DUCKDB_REMOTE_INSTALL
|
|
107403
|
+
throw BinderException("Remote extension installation is disabled through configuration");
|
|
107404
|
+
#else
|
|
107386
107405
|
string url_template = "http://extensions.duckdb.org/${REVISION}/${PLATFORM}/${NAME}.duckdb_extension.gz";
|
|
107387
107406
|
|
|
107388
107407
|
if (is_http_url) {
|
|
@@ -107421,6 +107440,7 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
|
|
|
107421
107440
|
if (out.bad()) {
|
|
107422
107441
|
throw IOException("Failed to write extension to %s", local_extension_path);
|
|
107423
107442
|
}
|
|
107443
|
+
#endif
|
|
107424
107444
|
}
|
|
107425
107445
|
|
|
107426
107446
|
} // namespace duckdb
|
|
@@ -107898,6 +107918,7 @@ void QueryProfiler::StartExplainAnalyze() {
|
|
|
107898
107918
|
}
|
|
107899
107919
|
|
|
107900
107920
|
void QueryProfiler::EndQuery() {
|
|
107921
|
+
lock_guard<mutex> guard(flush_lock);
|
|
107901
107922
|
if (!IsEnabled() || !running) {
|
|
107902
107923
|
return;
|
|
107903
107924
|
}
|
|
@@ -108056,10 +108077,10 @@ void OperatorProfiler::Flush(const PhysicalOperator *phys_op, ExpressionExecutor
|
|
|
108056
108077
|
}
|
|
108057
108078
|
|
|
108058
108079
|
void QueryProfiler::Flush(OperatorProfiler &profiler) {
|
|
108080
|
+
lock_guard<mutex> guard(flush_lock);
|
|
108059
108081
|
if (!IsEnabled() || !running) {
|
|
108060
108082
|
return;
|
|
108061
108083
|
}
|
|
108062
|
-
lock_guard<mutex> guard(flush_lock);
|
|
108063
108084
|
for (auto &node : profiler.timings) {
|
|
108064
108085
|
auto entry = tree_map.find(node.first);
|
|
108065
108086
|
D_ASSERT(entry != tree_map.end());
|
|
@@ -120734,8 +120755,8 @@ void Executor::Initialize(PhysicalOperator *plan) {
|
|
|
120734
120755
|
lock_guard<mutex> elock(executor_lock);
|
|
120735
120756
|
physical_plan = plan;
|
|
120736
120757
|
|
|
120737
|
-
|
|
120738
|
-
profiler
|
|
120758
|
+
this->profiler = context.profiler;
|
|
120759
|
+
profiler->Initialize(physical_plan);
|
|
120739
120760
|
this->producer = scheduler.CreateProducer();
|
|
120740
120761
|
|
|
120741
120762
|
auto root_pipeline = make_shared<Pipeline>(*this);
|
|
@@ -121146,9 +121167,7 @@ void Executor::ThrowExceptionInternal() { // LCOV_EXCL_START
|
|
|
121146
121167
|
} // LCOV_EXCL_STOP
|
|
121147
121168
|
|
|
121148
121169
|
void Executor::Flush(ThreadContext &tcontext) {
|
|
121149
|
-
|
|
121150
|
-
auto &profiler = QueryProfiler::Get(context);
|
|
121151
|
-
profiler.Flush(tcontext.profiler);
|
|
121170
|
+
profiler->Flush(tcontext.profiler);
|
|
121152
121171
|
}
|
|
121153
121172
|
|
|
121154
121173
|
bool Executor::GetPipelinesProgress(double ¤t_progress) { // LCOV_EXCL_START
|
|
@@ -138759,7 +138778,8 @@ unique_ptr<CreateStatement> Transformer::TransformCreateFunction(duckdb_libpgque
|
|
|
138759
138778
|
if (macro_func->default_parameters.find(param->alias) != macro_func->default_parameters.end()) {
|
|
138760
138779
|
throw ParserException("Duplicate default parameter: '%s'", param->alias);
|
|
138761
138780
|
}
|
|
138762
|
-
|
|
138781
|
+
auto alias = param->alias;
|
|
138782
|
+
macro_func->default_parameters[alias] = move(param);
|
|
138763
138783
|
} else if (param->GetExpressionClass() == ExpressionClass::COLUMN_REF) {
|
|
138764
138784
|
// positional parameters
|
|
138765
138785
|
if (!macro_func->default_parameters.empty()) {
|
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 "
|
|
15
|
-
#define DUCKDB_VERSION "0.3.2-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "6322c0deb"
|
|
15
|
+
#define DUCKDB_VERSION "0.3.2-dev788"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -1097,6 +1097,11 @@ struct StructType {
|
|
|
1097
1097
|
DUCKDB_API static idx_t GetChildCount(const LogicalType &type);
|
|
1098
1098
|
};
|
|
1099
1099
|
|
|
1100
|
+
struct MapType {
|
|
1101
|
+
DUCKDB_API static const LogicalType &KeyType(const LogicalType &type);
|
|
1102
|
+
DUCKDB_API static const LogicalType &ValueType(const LogicalType &type);
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1100
1105
|
|
|
1101
1106
|
string LogicalTypeIdToString(LogicalTypeId type);
|
|
1102
1107
|
|
|
@@ -9869,6 +9874,7 @@ class DataChunk;
|
|
|
9869
9874
|
class PhysicalOperator;
|
|
9870
9875
|
class PipelineExecutor;
|
|
9871
9876
|
class OperatorState;
|
|
9877
|
+
class QueryProfiler;
|
|
9872
9878
|
class ThreadContext;
|
|
9873
9879
|
class Task;
|
|
9874
9880
|
|
|
@@ -9968,6 +9974,8 @@ private:
|
|
|
9968
9974
|
vector<pair<ExceptionType, string>> exceptions;
|
|
9969
9975
|
//! List of events
|
|
9970
9976
|
vector<shared_ptr<Event>> events;
|
|
9977
|
+
//! The query profiler
|
|
9978
|
+
shared_ptr<QueryProfiler> profiler;
|
|
9971
9979
|
|
|
9972
9980
|
//! The amount of completed pipelines of the query
|
|
9973
9981
|
atomic<idx_t> completed_pipelines;
|
|
@@ -17117,7 +17125,7 @@ public:
|
|
|
17117
17125
|
DUCKDB_API ~ClientContext();
|
|
17118
17126
|
|
|
17119
17127
|
//! Query profiler
|
|
17120
|
-
|
|
17128
|
+
shared_ptr<QueryProfiler> profiler;
|
|
17121
17129
|
//! QueryProfiler History
|
|
17122
17130
|
unique_ptr<QueryProfilerHistory> query_profiler_history;
|
|
17123
17131
|
//! The database that this client is connected to
|