duckdb 0.4.1-dev23.0 → 0.4.1-dev33.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 +270 -20
- package/src/duckdb.hpp +15 -2
- package/src/parquet-amalgamation.cpp +36692 -36688
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -6039,6 +6039,7 @@ private:
|
|
|
6039
6039
|
} // namespace duckdb
|
|
6040
6040
|
|
|
6041
6041
|
|
|
6042
|
+
|
|
6042
6043
|
namespace duckdb {
|
|
6043
6044
|
|
|
6044
6045
|
ArrowSchemaWrapper::~ArrowSchemaWrapper() {
|
|
@@ -6235,6 +6236,7 @@ unique_ptr<DataChunk> ArrowUtil::FetchChunk(QueryResult *result, idx_t chunk_siz
|
|
|
6235
6236
|
} // namespace duckdb
|
|
6236
6237
|
|
|
6237
6238
|
|
|
6239
|
+
|
|
6238
6240
|
namespace duckdb {
|
|
6239
6241
|
|
|
6240
6242
|
void DuckDBAssertInternal(bool condition, const char *condition_name, const char *file, int linenr) {
|
|
@@ -6842,6 +6844,7 @@ uint64_t CycleCounter::Tick() const {
|
|
|
6842
6844
|
|
|
6843
6845
|
|
|
6844
6846
|
|
|
6847
|
+
|
|
6845
6848
|
namespace duckdb {
|
|
6846
6849
|
|
|
6847
6850
|
// LCOV_EXCL_START
|
|
@@ -13922,6 +13925,7 @@ void FileBuffer::Clear() {
|
|
|
13922
13925
|
#undef RemoveDirectory
|
|
13923
13926
|
|
|
13924
13927
|
#endif
|
|
13928
|
+
|
|
13925
13929
|
//===----------------------------------------------------------------------===//
|
|
13926
13930
|
// DuckDB
|
|
13927
13931
|
//
|
|
@@ -17282,6 +17286,7 @@ public:
|
|
|
17282
17286
|
|
|
17283
17287
|
|
|
17284
17288
|
|
|
17289
|
+
|
|
17285
17290
|
#include <cstdint>
|
|
17286
17291
|
#include <cstdio>
|
|
17287
17292
|
|
|
@@ -30782,7 +30787,8 @@ std::vector<Match> RegexFindAll(const std::string &input, const Regex ®ex) {
|
|
|
30782
30787
|
return matches;
|
|
30783
30788
|
}
|
|
30784
30789
|
|
|
30785
|
-
} // namespace duckdb_re2
|
|
30790
|
+
} // namespace duckdb_re2
|
|
30791
|
+
//===----------------------------------------------------------------------===//
|
|
30786
30792
|
// DuckDB
|
|
30787
30793
|
//
|
|
30788
30794
|
// duckdb/common/types/row_operations/row_aggregate.cpp
|
|
@@ -37172,6 +37178,7 @@ private:
|
|
|
37172
37178
|
|
|
37173
37179
|
|
|
37174
37180
|
|
|
37181
|
+
|
|
37175
37182
|
//===----------------------------------------------------------------------===//
|
|
37176
37183
|
// DuckDB
|
|
37177
37184
|
//
|
|
@@ -38252,7 +38259,8 @@ unique_ptr<RenderTree> TreeRenderer::CreateTree(const Pipeline &op) {
|
|
|
38252
38259
|
return CreateRenderTree<PipelineRenderNode>(*node);
|
|
38253
38260
|
}
|
|
38254
38261
|
|
|
38255
|
-
} // namespace duckdb
|
|
38262
|
+
} // namespace duckdb
|
|
38263
|
+
//===----------------------------------------------------------------------===//
|
|
38256
38264
|
// DuckDB
|
|
38257
38265
|
//
|
|
38258
38266
|
// duckdb/common/types/batched_chunk_collection.hpp
|
|
@@ -39350,6 +39358,7 @@ struct ArrowAuxiliaryData : VectorAuxiliaryData {
|
|
|
39350
39358
|
} // namespace duckdb
|
|
39351
39359
|
|
|
39352
39360
|
|
|
39361
|
+
|
|
39353
39362
|
namespace duckdb {
|
|
39354
39363
|
|
|
39355
39364
|
DataChunk::DataChunk() : count(0), capacity(STANDARD_VECTOR_SIZE) {
|
|
@@ -41677,6 +41686,7 @@ private:
|
|
|
41677
41686
|
|
|
41678
41687
|
|
|
41679
41688
|
|
|
41689
|
+
|
|
41680
41690
|
namespace duckdb {
|
|
41681
41691
|
|
|
41682
41692
|
HyperLogLog::HyperLogLog() : hll(nullptr) {
|
|
@@ -61615,6 +61625,7 @@ public:
|
|
|
61615
61625
|
|
|
61616
61626
|
} // namespace duckdb
|
|
61617
61627
|
|
|
61628
|
+
|
|
61618
61629
|
namespace duckdb {
|
|
61619
61630
|
|
|
61620
61631
|
class PhysicalExecute : public PhysicalOperator {
|
|
@@ -62311,6 +62322,12 @@ class DuckDB;
|
|
|
62311
62322
|
|
|
62312
62323
|
enum class ExtensionLoadResult : uint8_t { LOADED_EXTENSION = 0, EXTENSION_UNKNOWN = 1, NOT_LOADED = 2 };
|
|
62313
62324
|
|
|
62325
|
+
struct DefaultExtension {
|
|
62326
|
+
const char *name;
|
|
62327
|
+
const char *description;
|
|
62328
|
+
bool statically_loaded;
|
|
62329
|
+
};
|
|
62330
|
+
|
|
62314
62331
|
class ExtensionHelper {
|
|
62315
62332
|
public:
|
|
62316
62333
|
static void LoadAllExtensions(DuckDB &db);
|
|
@@ -62320,6 +62337,11 @@ public:
|
|
|
62320
62337
|
static void InstallExtension(DatabaseInstance &db, const string &extension, bool force_install);
|
|
62321
62338
|
static void LoadExternalExtension(DatabaseInstance &db, const string &extension);
|
|
62322
62339
|
|
|
62340
|
+
static string ExtensionDirectory(FileSystem &fs);
|
|
62341
|
+
|
|
62342
|
+
static idx_t DefaultExtensionCount();
|
|
62343
|
+
static DefaultExtension GetDefaultExtension(idx_t index);
|
|
62344
|
+
|
|
62323
62345
|
private:
|
|
62324
62346
|
static const vector<string> PathComponents();
|
|
62325
62347
|
|
|
@@ -73810,6 +73832,7 @@ public:
|
|
|
73810
73832
|
|
|
73811
73833
|
|
|
73812
73834
|
|
|
73835
|
+
|
|
73813
73836
|
namespace duckdb {
|
|
73814
73837
|
|
|
73815
73838
|
PhysicalCreateType::PhysicalCreateType(unique_ptr<CreateTypeInfo> info, idx_t estimated_cardinality)
|
|
@@ -95106,6 +95129,7 @@ void ListPositionFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
95106
95129
|
} // namespace duckdb
|
|
95107
95130
|
|
|
95108
95131
|
|
|
95132
|
+
|
|
95109
95133
|
//===----------------------------------------------------------------------===//
|
|
95110
95134
|
// DuckDB
|
|
95111
95135
|
//
|
|
@@ -96523,6 +96547,7 @@ void ListSortFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
96523
96547
|
|
|
96524
96548
|
|
|
96525
96549
|
|
|
96550
|
+
|
|
96526
96551
|
namespace duckdb {
|
|
96527
96552
|
|
|
96528
96553
|
static void ListValueFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
@@ -107057,6 +107082,10 @@ struct DuckDBDependenciesFun {
|
|
|
107057
107082
|
static void RegisterFunction(BuiltinFunctions &set);
|
|
107058
107083
|
};
|
|
107059
107084
|
|
|
107085
|
+
struct DuckDBExtensionsFun {
|
|
107086
|
+
static void RegisterFunction(BuiltinFunctions &set);
|
|
107087
|
+
};
|
|
107088
|
+
|
|
107060
107089
|
struct DuckDBFunctionsFun {
|
|
107061
107090
|
static void RegisterFunction(BuiltinFunctions &set);
|
|
107062
107091
|
};
|
|
@@ -108655,6 +108684,152 @@ void DuckDBDependenciesFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
108655
108684
|
|
|
108656
108685
|
|
|
108657
108686
|
|
|
108687
|
+
namespace duckdb {
|
|
108688
|
+
|
|
108689
|
+
struct ExtensionInformation {
|
|
108690
|
+
string name;
|
|
108691
|
+
bool loaded = false;
|
|
108692
|
+
bool installed = false;
|
|
108693
|
+
string file_path;
|
|
108694
|
+
string description;
|
|
108695
|
+
};
|
|
108696
|
+
|
|
108697
|
+
struct DuckDBExtensionsData : public GlobalTableFunctionState {
|
|
108698
|
+
DuckDBExtensionsData() : offset(0) {
|
|
108699
|
+
}
|
|
108700
|
+
|
|
108701
|
+
vector<ExtensionInformation> entries;
|
|
108702
|
+
idx_t offset;
|
|
108703
|
+
};
|
|
108704
|
+
|
|
108705
|
+
static unique_ptr<FunctionData> DuckDBExtensionsBind(ClientContext &context, TableFunctionBindInput &input,
|
|
108706
|
+
vector<LogicalType> &return_types, vector<string> &names) {
|
|
108707
|
+
names.emplace_back("extension_name");
|
|
108708
|
+
return_types.emplace_back(LogicalType::VARCHAR);
|
|
108709
|
+
|
|
108710
|
+
names.emplace_back("loaded");
|
|
108711
|
+
return_types.emplace_back(LogicalType::BOOLEAN);
|
|
108712
|
+
|
|
108713
|
+
names.emplace_back("installed");
|
|
108714
|
+
return_types.emplace_back(LogicalType::BOOLEAN);
|
|
108715
|
+
|
|
108716
|
+
names.emplace_back("install_path");
|
|
108717
|
+
return_types.emplace_back(LogicalType::VARCHAR);
|
|
108718
|
+
|
|
108719
|
+
names.emplace_back("description");
|
|
108720
|
+
return_types.emplace_back(LogicalType::VARCHAR);
|
|
108721
|
+
|
|
108722
|
+
return nullptr;
|
|
108723
|
+
}
|
|
108724
|
+
|
|
108725
|
+
unique_ptr<GlobalTableFunctionState> DuckDBExtensionsInit(ClientContext &context, TableFunctionInitInput &input) {
|
|
108726
|
+
auto result = make_unique<DuckDBExtensionsData>();
|
|
108727
|
+
|
|
108728
|
+
auto &fs = FileSystem::GetFileSystem(context);
|
|
108729
|
+
auto &db = DatabaseInstance::GetDatabase(context);
|
|
108730
|
+
|
|
108731
|
+
map<string, ExtensionInformation> installed_extensions;
|
|
108732
|
+
auto extension_count = ExtensionHelper::DefaultExtensionCount();
|
|
108733
|
+
for (idx_t i = 0; i < extension_count; i++) {
|
|
108734
|
+
auto extension = ExtensionHelper::GetDefaultExtension(i);
|
|
108735
|
+
ExtensionInformation info;
|
|
108736
|
+
info.name = extension.name;
|
|
108737
|
+
info.installed = extension.statically_loaded;
|
|
108738
|
+
info.loaded = false;
|
|
108739
|
+
info.file_path = extension.statically_loaded ? "(BUILT-IN)" : string();
|
|
108740
|
+
info.description = extension.description;
|
|
108741
|
+
installed_extensions[info.name] = move(info);
|
|
108742
|
+
}
|
|
108743
|
+
|
|
108744
|
+
// scan the install directory for installed extensions
|
|
108745
|
+
auto ext_directory = ExtensionHelper::ExtensionDirectory(fs);
|
|
108746
|
+
fs.ListFiles(ext_directory, [&](const string &path, bool is_directory) {
|
|
108747
|
+
if (!StringUtil::EndsWith(path, ".duckdb_extension")) {
|
|
108748
|
+
return;
|
|
108749
|
+
}
|
|
108750
|
+
ExtensionInformation info;
|
|
108751
|
+
info.name = fs.ExtractBaseName(path);
|
|
108752
|
+
info.loaded = false;
|
|
108753
|
+
info.file_path = fs.JoinPath(ext_directory, path);
|
|
108754
|
+
auto entry = installed_extensions.find(info.name);
|
|
108755
|
+
if (entry == installed_extensions.end()) {
|
|
108756
|
+
installed_extensions[info.name] = move(info);
|
|
108757
|
+
} else {
|
|
108758
|
+
if (!entry->second.loaded) {
|
|
108759
|
+
entry->second.file_path = info.file_path;
|
|
108760
|
+
}
|
|
108761
|
+
entry->second.installed = true;
|
|
108762
|
+
}
|
|
108763
|
+
});
|
|
108764
|
+
|
|
108765
|
+
// now check the list of currently loaded extensions
|
|
108766
|
+
auto &loaded_extensions = db.LoadedExtensions();
|
|
108767
|
+
for (auto &ext_name : loaded_extensions) {
|
|
108768
|
+
auto entry = installed_extensions.find(ext_name);
|
|
108769
|
+
if (entry == installed_extensions.end()) {
|
|
108770
|
+
ExtensionInformation info;
|
|
108771
|
+
info.name = ext_name;
|
|
108772
|
+
info.loaded = true;
|
|
108773
|
+
installed_extensions[ext_name] = move(info);
|
|
108774
|
+
} else {
|
|
108775
|
+
entry->second.loaded = true;
|
|
108776
|
+
}
|
|
108777
|
+
}
|
|
108778
|
+
|
|
108779
|
+
result->entries.reserve(installed_extensions.size());
|
|
108780
|
+
for (auto &kv : installed_extensions) {
|
|
108781
|
+
result->entries.push_back(move(kv.second));
|
|
108782
|
+
}
|
|
108783
|
+
return move(result);
|
|
108784
|
+
}
|
|
108785
|
+
|
|
108786
|
+
void DuckDBExtensionsFunction(ClientContext &context, TableFunctionInput &data_p, DataChunk &output) {
|
|
108787
|
+
auto &data = (DuckDBExtensionsData &)*data_p.global_state;
|
|
108788
|
+
if (data.offset >= data.entries.size()) {
|
|
108789
|
+
// finished returning values
|
|
108790
|
+
return;
|
|
108791
|
+
}
|
|
108792
|
+
// start returning values
|
|
108793
|
+
// either fill up the chunk or return all the remaining columns
|
|
108794
|
+
idx_t count = 0;
|
|
108795
|
+
while (data.offset < data.entries.size() && count < STANDARD_VECTOR_SIZE) {
|
|
108796
|
+
auto &entry = data.entries[data.offset];
|
|
108797
|
+
|
|
108798
|
+
// return values:
|
|
108799
|
+
// extension_name LogicalType::VARCHAR
|
|
108800
|
+
output.SetValue(0, count, Value(entry.name));
|
|
108801
|
+
// loaded LogicalType::BOOLEAN
|
|
108802
|
+
output.SetValue(1, count, Value::BOOLEAN(entry.loaded));
|
|
108803
|
+
// installed LogicalType::BOOLEAN
|
|
108804
|
+
output.SetValue(2, count, !entry.installed && entry.loaded ? Value() : Value::BOOLEAN(entry.installed));
|
|
108805
|
+
// install_path LogicalType::VARCHAR
|
|
108806
|
+
output.SetValue(3, count, Value(entry.file_path));
|
|
108807
|
+
// description LogicalType::VARCHAR
|
|
108808
|
+
output.SetValue(4, count, Value(entry.description));
|
|
108809
|
+
|
|
108810
|
+
data.offset++;
|
|
108811
|
+
count++;
|
|
108812
|
+
}
|
|
108813
|
+
output.SetCardinality(count);
|
|
108814
|
+
}
|
|
108815
|
+
|
|
108816
|
+
void DuckDBExtensionsFun::RegisterFunction(BuiltinFunctions &set) {
|
|
108817
|
+
TableFunctionSet functions("duckdb_extensions");
|
|
108818
|
+
functions.AddFunction(TableFunction({}, DuckDBExtensionsFunction, DuckDBExtensionsBind, DuckDBExtensionsInit));
|
|
108819
|
+
set.AddFunction(functions);
|
|
108820
|
+
}
|
|
108821
|
+
|
|
108822
|
+
} // namespace duckdb
|
|
108823
|
+
|
|
108824
|
+
|
|
108825
|
+
|
|
108826
|
+
|
|
108827
|
+
|
|
108828
|
+
|
|
108829
|
+
|
|
108830
|
+
|
|
108831
|
+
|
|
108832
|
+
|
|
108658
108833
|
|
|
108659
108834
|
|
|
108660
108835
|
|
|
@@ -111298,6 +111473,7 @@ void BuiltinFunctions::RegisterSQLiteFunctions() {
|
|
|
111298
111473
|
DuckDBIndexesFun::RegisterFunction(*this);
|
|
111299
111474
|
DuckDBSchemasFun::RegisterFunction(*this);
|
|
111300
111475
|
DuckDBDependenciesFun::RegisterFunction(*this);
|
|
111476
|
+
DuckDBExtensionsFun::RegisterFunction(*this);
|
|
111301
111477
|
DuckDBSequencesFun::RegisterFunction(*this);
|
|
111302
111478
|
DuckDBSettingsFun::RegisterFunction(*this);
|
|
111303
111479
|
DuckDBTablesFun::RegisterFunction(*this);
|
|
@@ -115088,6 +115264,7 @@ private:
|
|
|
115088
115264
|
|
|
115089
115265
|
|
|
115090
115266
|
|
|
115267
|
+
|
|
115091
115268
|
//===----------------------------------------------------------------------===//
|
|
115092
115269
|
// DuckDB
|
|
115093
115270
|
//
|
|
@@ -116606,6 +116783,7 @@ bool ClientContextFileOpener::TryGetCurrentSetting(const string &key, Value &res
|
|
|
116606
116783
|
|
|
116607
116784
|
|
|
116608
116785
|
|
|
116786
|
+
|
|
116609
116787
|
namespace duckdb {
|
|
116610
116788
|
|
|
116611
116789
|
ClientData::ClientData(ClientContext &context) : catalog_search_path(make_unique<CatalogSearchPath>(context)) {
|
|
@@ -117863,6 +118041,10 @@ idx_t DatabaseInstance::NumberOfThreads() {
|
|
|
117863
118041
|
return scheduler->NumberOfThreads();
|
|
117864
118042
|
}
|
|
117865
118043
|
|
|
118044
|
+
const unordered_set<std::string> &DatabaseInstance::LoadedExtensions() {
|
|
118045
|
+
return loaded_extensions;
|
|
118046
|
+
}
|
|
118047
|
+
|
|
117866
118048
|
idx_t DuckDB::NumberOfThreads() {
|
|
117867
118049
|
return instance->NumberOfThreads();
|
|
117868
118050
|
}
|
|
@@ -117891,31 +118073,52 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
|
|
|
117891
118073
|
|
|
117892
118074
|
|
|
117893
118075
|
#if defined(BUILD_ICU_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118076
|
+
#define ICU_STATICALLY_LOADED true
|
|
117894
118077
|
#include "icu-extension.hpp"
|
|
118078
|
+
#else
|
|
118079
|
+
#define ICU_STATICALLY_LOADED false
|
|
117895
118080
|
#endif
|
|
117896
118081
|
|
|
117897
118082
|
#if defined(BUILD_PARQUET_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118083
|
+
#define PARQUET_STATICALLY_LOADED true
|
|
117898
118084
|
#include "parquet-extension.hpp"
|
|
118085
|
+
#else
|
|
118086
|
+
#define PARQUET_STATICALLY_LOADED false
|
|
117899
118087
|
#endif
|
|
117900
118088
|
|
|
117901
118089
|
#if defined(BUILD_TPCH_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118090
|
+
#define TPCH_STATICALLY_LOADED true
|
|
117902
118091
|
#include "tpch-extension.hpp"
|
|
118092
|
+
#else
|
|
118093
|
+
#define TPCH_STATICALLY_LOADED false
|
|
117903
118094
|
#endif
|
|
117904
118095
|
|
|
117905
118096
|
#if defined(BUILD_TPCDS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118097
|
+
#define TPCDS_STATICALLY_LOADED true
|
|
117906
118098
|
#include "tpcds-extension.hpp"
|
|
118099
|
+
#else
|
|
118100
|
+
#define TPCDS_STATICALLY_LOADED false
|
|
117907
118101
|
#endif
|
|
117908
118102
|
|
|
117909
118103
|
#if defined(BUILD_SUBSTRAIT_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118104
|
+
#define SUBSTRAIT_STATICALLY_LOADED true
|
|
117910
118105
|
#include "substrait-extension.hpp"
|
|
118106
|
+
#else
|
|
118107
|
+
#define SUBSTRAIT_STATICALLY_LOADED false
|
|
117911
118108
|
#endif
|
|
117912
118109
|
|
|
117913
118110
|
#if defined(BUILD_FTS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118111
|
+
#define FTS_STATICALLY_LOADED true
|
|
117914
118112
|
#include "fts-extension.hpp"
|
|
118113
|
+
#else
|
|
118114
|
+
#define FTS_STATICALLY_LOADED false
|
|
117915
118115
|
#endif
|
|
117916
118116
|
|
|
117917
118117
|
#if defined(BUILD_HTTPFS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118118
|
+
#define HTTPFS_STATICALLY_LOADED true
|
|
117918
118119
|
#include "httpfs-extension.hpp"
|
|
118120
|
+
#else
|
|
118121
|
+
#define HTTPFS_STATICALLY_LOADED false
|
|
117919
118122
|
#endif
|
|
117920
118123
|
|
|
117921
118124
|
#if defined(BUILD_VISUALIZER_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
@@ -117923,7 +118126,10 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
|
|
|
117923
118126
|
#endif
|
|
117924
118127
|
|
|
117925
118128
|
#if defined(BUILD_JSON_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
118129
|
+
#define JSON_STATICALLY_LOADED true
|
|
117926
118130
|
#include "json-extension.hpp"
|
|
118131
|
+
#else
|
|
118132
|
+
#define JSON_STATICALLY_LOADED false
|
|
117927
118133
|
#endif
|
|
117928
118134
|
|
|
117929
118135
|
#if defined(BUILD_EXCEL_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
@@ -117936,6 +118142,37 @@ string ClientConfig::ExtractTimezoneFromConfig(ClientConfig &config) {
|
|
|
117936
118142
|
|
|
117937
118143
|
namespace duckdb {
|
|
117938
118144
|
|
|
118145
|
+
//===--------------------------------------------------------------------===//
|
|
118146
|
+
// Default Extensions
|
|
118147
|
+
//===--------------------------------------------------------------------===//
|
|
118148
|
+
static DefaultExtension internal_extensions[] = {
|
|
118149
|
+
{"icu", "Adds support for time zones and collations using the ICU library", ICU_STATICALLY_LOADED},
|
|
118150
|
+
{"parquet", "Adds support for reading and writing parquet files", PARQUET_STATICALLY_LOADED},
|
|
118151
|
+
{"tpch", "Adds TPC-H data generation and query support", TPCH_STATICALLY_LOADED},
|
|
118152
|
+
{"tpcds", "Adds TPC-DS data generation and query support", TPCDS_STATICALLY_LOADED},
|
|
118153
|
+
{"substrait", "Adds support for the Substrait integration", SUBSTRAIT_STATICALLY_LOADED},
|
|
118154
|
+
{"fts", "Adds support for Full-Text Search Indexes", FTS_STATICALLY_LOADED},
|
|
118155
|
+
{"httpfs", "Adds support for reading and writing files over a HTTP(S) connection", HTTPFS_STATICALLY_LOADED},
|
|
118156
|
+
{"json", "Adds support for JSON operations", JSON_STATICALLY_LOADED},
|
|
118157
|
+
{"sqlite_scanner", "Adds support for reading SQLite database files", false},
|
|
118158
|
+
{"postgres_scanner", "Adds support for reading from a Postgres database", false},
|
|
118159
|
+
{nullptr, nullptr, false}};
|
|
118160
|
+
|
|
118161
|
+
idx_t ExtensionHelper::DefaultExtensionCount() {
|
|
118162
|
+
idx_t index;
|
|
118163
|
+
for (index = 0; internal_extensions[index].name != nullptr; index++) {
|
|
118164
|
+
}
|
|
118165
|
+
return index;
|
|
118166
|
+
}
|
|
118167
|
+
|
|
118168
|
+
DefaultExtension ExtensionHelper::GetDefaultExtension(idx_t index) {
|
|
118169
|
+
D_ASSERT(index < DefaultExtensionCount());
|
|
118170
|
+
return internal_extensions[index];
|
|
118171
|
+
}
|
|
118172
|
+
|
|
118173
|
+
//===--------------------------------------------------------------------===//
|
|
118174
|
+
// Load Statically Compiled Extension
|
|
118175
|
+
//===--------------------------------------------------------------------===//
|
|
117939
118176
|
void ExtensionHelper::LoadAllExtensions(DuckDB &db) {
|
|
117940
118177
|
unordered_set<string> extensions {"parquet", "icu", "tpch", "tpcds", "fts", "httpfs",
|
|
117941
118178
|
"substrait", "visualizer", "json", "excel", "sqlsmith"};
|
|
@@ -117944,9 +118181,6 @@ void ExtensionHelper::LoadAllExtensions(DuckDB &db) {
|
|
|
117944
118181
|
}
|
|
117945
118182
|
}
|
|
117946
118183
|
|
|
117947
|
-
//===--------------------------------------------------------------------===//
|
|
117948
|
-
// Load Statically Compiled Extension
|
|
117949
|
-
//===--------------------------------------------------------------------===//
|
|
117950
118184
|
ExtensionLoadResult ExtensionHelper::LoadExtension(DuckDB &db, const std::string &extension) {
|
|
117951
118185
|
return LoadExtensionInternal(db, extension, false);
|
|
117952
118186
|
}
|
|
@@ -117970,28 +118204,28 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
|
|
|
117970
118204
|
}
|
|
117971
118205
|
#endif
|
|
117972
118206
|
if (extension == "parquet") {
|
|
117973
|
-
#if
|
|
118207
|
+
#if PARQUET_STATICALLY_LOADED
|
|
117974
118208
|
db.LoadExtension<ParquetExtension>();
|
|
117975
118209
|
#else
|
|
117976
118210
|
// parquet extension required but not build: skip this test
|
|
117977
118211
|
return ExtensionLoadResult::NOT_LOADED;
|
|
117978
118212
|
#endif
|
|
117979
118213
|
} else if (extension == "icu") {
|
|
117980
|
-
#if
|
|
118214
|
+
#if ICU_STATICALLY_LOADED
|
|
117981
118215
|
db.LoadExtension<ICUExtension>();
|
|
117982
118216
|
#else
|
|
117983
118217
|
// icu extension required but not build: skip this test
|
|
117984
118218
|
return ExtensionLoadResult::NOT_LOADED;
|
|
117985
118219
|
#endif
|
|
117986
118220
|
} else if (extension == "tpch") {
|
|
117987
|
-
#if
|
|
118221
|
+
#if TPCH_STATICALLY_LOADED
|
|
117988
118222
|
db.LoadExtension<TPCHExtension>();
|
|
117989
118223
|
#else
|
|
117990
118224
|
// icu extension required but not build: skip this test
|
|
117991
118225
|
return ExtensionLoadResult::NOT_LOADED;
|
|
117992
118226
|
#endif
|
|
117993
118227
|
} else if (extension == "substrait") {
|
|
117994
|
-
#if
|
|
118228
|
+
#if SUBSTRAIT_STATICALLY_LOADED
|
|
117995
118229
|
|
|
117996
118230
|
db.LoadExtension<SubstraitExtension>();
|
|
117997
118231
|
#else
|
|
@@ -117999,21 +118233,21 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
|
|
|
117999
118233
|
return ExtensionLoadResult::NOT_LOADED;
|
|
118000
118234
|
#endif
|
|
118001
118235
|
} else if (extension == "tpcds") {
|
|
118002
|
-
#if
|
|
118236
|
+
#if TPCDS_STATICALLY_LOADED
|
|
118003
118237
|
db.LoadExtension<TPCDSExtension>();
|
|
118004
118238
|
#else
|
|
118005
118239
|
// icu extension required but not build: skip this test
|
|
118006
118240
|
return ExtensionLoadResult::NOT_LOADED;
|
|
118007
118241
|
#endif
|
|
118008
118242
|
} else if (extension == "fts") {
|
|
118009
|
-
#if
|
|
118243
|
+
#if FTS_STATICALLY_LOADED
|
|
118010
118244
|
db.LoadExtension<FTSExtension>();
|
|
118011
118245
|
#else
|
|
118012
118246
|
// fts extension required but not build: skip this test
|
|
118013
118247
|
return ExtensionLoadResult::NOT_LOADED;
|
|
118014
118248
|
#endif
|
|
118015
118249
|
} else if (extension == "httpfs") {
|
|
118016
|
-
#if
|
|
118250
|
+
#if HTTPFS_STATICALLY_LOADED
|
|
118017
118251
|
db.LoadExtension<HTTPFsExtension>();
|
|
118018
118252
|
#else
|
|
118019
118253
|
return ExtensionLoadResult::NOT_LOADED;
|
|
@@ -118026,7 +118260,7 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
|
|
|
118026
118260
|
return ExtensionLoadResult::NOT_LOADED;
|
|
118027
118261
|
#endif
|
|
118028
118262
|
} else if (extension == "json") {
|
|
118029
|
-
#if
|
|
118263
|
+
#if JSON_STATICALLY_LOADED
|
|
118030
118264
|
db.LoadExtension<JSONExtension>();
|
|
118031
118265
|
#else
|
|
118032
118266
|
// json extension required but not build: skip this test
|
|
@@ -126269,13 +126503,7 @@ const vector<string> ExtensionHelper::PathComponents() {
|
|
|
126269
126503
|
return vector<string> {".duckdb", "extensions", DuckDB::SourceID(), DuckDB::Platform()};
|
|
126270
126504
|
}
|
|
126271
126505
|
|
|
126272
|
-
|
|
126273
|
-
auto &config = DBConfig::GetConfig(db);
|
|
126274
|
-
if (!config.enable_external_access) {
|
|
126275
|
-
throw PermissionException("Installing extensions is disabled through configuration");
|
|
126276
|
-
}
|
|
126277
|
-
auto &fs = FileSystem::GetFileSystem(db);
|
|
126278
|
-
|
|
126506
|
+
string ExtensionHelper::ExtensionDirectory(FileSystem &fs) {
|
|
126279
126507
|
string local_path = fs.GetHomeDirectory();
|
|
126280
126508
|
if (!fs.DirectoryExists(local_path)) {
|
|
126281
126509
|
throw InternalException("Can't find the home directory at " + local_path);
|
|
@@ -126287,6 +126515,17 @@ void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &exten
|
|
|
126287
126515
|
fs.CreateDirectory(local_path);
|
|
126288
126516
|
}
|
|
126289
126517
|
}
|
|
126518
|
+
return local_path;
|
|
126519
|
+
}
|
|
126520
|
+
|
|
126521
|
+
void ExtensionHelper::InstallExtension(DatabaseInstance &db, const string &extension, bool force_install) {
|
|
126522
|
+
auto &config = DBConfig::GetConfig(db);
|
|
126523
|
+
if (!config.enable_external_access) {
|
|
126524
|
+
throw PermissionException("Installing extensions is disabled through configuration");
|
|
126525
|
+
}
|
|
126526
|
+
auto &fs = FileSystem::GetFileSystem(db);
|
|
126527
|
+
|
|
126528
|
+
string local_path = ExtensionDirectory(fs);
|
|
126290
126529
|
|
|
126291
126530
|
auto extension_name = fs.ExtractBaseName(extension);
|
|
126292
126531
|
|
|
@@ -132163,6 +132402,7 @@ private:
|
|
|
132163
132402
|
|
|
132164
132403
|
|
|
132165
132404
|
|
|
132405
|
+
|
|
132166
132406
|
namespace duckdb {
|
|
132167
132407
|
|
|
132168
132408
|
using ExpressionValueInformation = FilterCombiner::ExpressionValueInformation;
|
|
@@ -135716,6 +135956,7 @@ public:
|
|
|
135716
135956
|
|
|
135717
135957
|
} // namespace duckdb
|
|
135718
135958
|
|
|
135959
|
+
|
|
135719
135960
|
//===----------------------------------------------------------------------===//
|
|
135720
135961
|
// DuckDB
|
|
135721
135962
|
//
|
|
@@ -147397,6 +147638,7 @@ unique_ptr<ParsedExpression> BetweenExpression::Deserialize(ExpressionType type,
|
|
|
147397
147638
|
|
|
147398
147639
|
|
|
147399
147640
|
|
|
147641
|
+
|
|
147400
147642
|
namespace duckdb {
|
|
147401
147643
|
|
|
147402
147644
|
CaseExpression::CaseExpression() : ParsedExpression(ExpressionType::CASE_EXPR, ExpressionClass::CASE) {
|
|
@@ -148597,6 +148839,7 @@ string KeywordHelper::WriteOptionallyQuoted(const string &text, char quote) {
|
|
|
148597
148839
|
|
|
148598
148840
|
|
|
148599
148841
|
|
|
148842
|
+
|
|
148600
148843
|
namespace duckdb {
|
|
148601
148844
|
|
|
148602
148845
|
AlterInfo::AlterInfo(AlterType type, string schema_p, string name_p)
|
|
@@ -160127,6 +160370,7 @@ unique_ptr<AlterStatement> Transformer::TransformAlterSequence(duckdb_libpgquery
|
|
|
160127
160370
|
|
|
160128
160371
|
|
|
160129
160372
|
|
|
160373
|
+
|
|
160130
160374
|
namespace duckdb {
|
|
160131
160375
|
|
|
160132
160376
|
unique_ptr<AlterStatement> Transformer::TransformAlter(duckdb_libpgquery::PGNode *node) {
|
|
@@ -160844,6 +161088,7 @@ unique_ptr<CreateStatement> Transformer::TransformCreateType(duckdb_libpgquery::
|
|
|
160844
161088
|
|
|
160845
161089
|
|
|
160846
161090
|
|
|
161091
|
+
|
|
160847
161092
|
namespace duckdb {
|
|
160848
161093
|
|
|
160849
161094
|
unique_ptr<CreateStatement> Transformer::TransformCreateView(duckdb_libpgquery::PGNode *node) {
|
|
@@ -171350,6 +171595,7 @@ BindResult ColumnAliasBinder::BindAlias(ExpressionBinder &enclosing_binder, Colu
|
|
|
171350
171595
|
|
|
171351
171596
|
} // namespace duckdb
|
|
171352
171597
|
|
|
171598
|
+
|
|
171353
171599
|
namespace duckdb {
|
|
171354
171600
|
|
|
171355
171601
|
ConstantBinder::ConstantBinder(Binder &binder, ClientContext &context, string clause)
|
|
@@ -174867,6 +175113,7 @@ public:
|
|
|
174867
175113
|
#endif
|
|
174868
175114
|
|
|
174869
175115
|
|
|
175116
|
+
|
|
174870
175117
|
namespace duckdb {
|
|
174871
175118
|
|
|
174872
175119
|
BlockHandle::BlockHandle(DatabaseInstance &db, block_id_t block_id_p)
|
|
@@ -178625,6 +178872,7 @@ public:
|
|
|
178625
178872
|
|
|
178626
178873
|
|
|
178627
178874
|
|
|
178875
|
+
|
|
178628
178876
|
namespace duckdb {
|
|
178629
178877
|
|
|
178630
178878
|
struct StringHash {
|
|
@@ -179272,6 +179520,7 @@ bool DictionaryCompressionFun::TypeIsSupported(PhysicalType type) {
|
|
|
179272
179520
|
|
|
179273
179521
|
|
|
179274
179522
|
|
|
179523
|
+
|
|
179275
179524
|
namespace duckdb {
|
|
179276
179525
|
|
|
179277
179526
|
//===--------------------------------------------------------------------===//
|
|
@@ -188683,6 +188932,7 @@ struct UpdateInfo {
|
|
|
188683
188932
|
|
|
188684
188933
|
} // namespace duckdb
|
|
188685
188934
|
|
|
188935
|
+
|
|
188686
188936
|
namespace duckdb {
|
|
188687
188937
|
|
|
188688
188938
|
static UpdateSegment::initialize_update_function_t GetInitializeUpdateFunction(PhysicalType type);
|