duckdb 0.3.3-dev135.0 → 0.3.3-dev149.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 +116 -27
- package/src/duckdb.hpp +2 -2
- package/src/parquet-amalgamation.cpp +36686 -36686
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -42519,12 +42519,18 @@ void VectorOperations::Copy(const Vector &source, Vector &target, idx_t source_c
|
|
|
42519
42519
|
namespace duckdb {
|
|
42520
42520
|
|
|
42521
42521
|
struct HashOp {
|
|
42522
|
+
static const hash_t NULL_HASH = 0xbf58476d1ce4e5b9;
|
|
42523
|
+
|
|
42522
42524
|
template <class T>
|
|
42523
42525
|
static inline hash_t Operation(T input, bool is_null) {
|
|
42524
|
-
return
|
|
42526
|
+
return is_null ? NULL_HASH : duckdb::Hash<T>(input);
|
|
42525
42527
|
}
|
|
42526
42528
|
};
|
|
42527
42529
|
|
|
42530
|
+
static inline hash_t CombineHashScalar(hash_t a, hash_t b) {
|
|
42531
|
+
return (a * UINT64_C(0xbf58476d1ce4e5b9)) ^ b;
|
|
42532
|
+
}
|
|
42533
|
+
|
|
42528
42534
|
template <bool HAS_RSEL, class T>
|
|
42529
42535
|
static inline void TightLoopHash(T *__restrict ldata, hash_t *__restrict result_data, const SelectionVector *rsel,
|
|
42530
42536
|
idx_t count, const SelectionVector *__restrict sel_vector, ValidityMask &mask) {
|
|
@@ -42566,7 +42572,7 @@ template <bool HAS_RSEL, bool FIRST_HASH>
|
|
|
42566
42572
|
static inline void StructLoopHash(Vector &input, Vector &hashes, const SelectionVector *rsel, idx_t count) {
|
|
42567
42573
|
auto &children = StructVector::GetEntries(input);
|
|
42568
42574
|
|
|
42569
|
-
D_ASSERT(children.
|
|
42575
|
+
D_ASSERT(!children.empty());
|
|
42570
42576
|
idx_t col_no = 0;
|
|
42571
42577
|
if (HAS_RSEL) {
|
|
42572
42578
|
if (FIRST_HASH) {
|
|
@@ -42596,14 +42602,81 @@ static inline void ListLoopHash(Vector &input, Vector &hashes, const SelectionVe
|
|
|
42596
42602
|
VectorData idata;
|
|
42597
42603
|
input.Orrify(count, idata);
|
|
42598
42604
|
const auto ldata = (const list_entry_t *)idata.data;
|
|
42599
|
-
|
|
42605
|
+
|
|
42606
|
+
// Hash the children into a temporary
|
|
42607
|
+
auto &child = ListVector::GetEntry(input);
|
|
42608
|
+
const auto child_count = ListVector::GetListSize(input);
|
|
42609
|
+
|
|
42610
|
+
Vector child_hashes(LogicalType::HASH, child_count);
|
|
42611
|
+
VectorOperations::Hash(child, child_hashes, child_count);
|
|
42612
|
+
auto chdata = FlatVector::GetData<hash_t>(child_hashes);
|
|
42613
|
+
|
|
42614
|
+
// Reduce the number of entries to check to the non-empty ones
|
|
42615
|
+
SelectionVector unprocessed(count);
|
|
42616
|
+
SelectionVector cursor(HAS_RSEL ? STANDARD_VECTOR_SIZE : count);
|
|
42617
|
+
idx_t remaining = 0;
|
|
42618
|
+
for (idx_t i = 0; i < count; ++i) {
|
|
42600
42619
|
const idx_t ridx = HAS_RSEL ? rsel->get_index(i) : i;
|
|
42601
42620
|
const auto lidx = idata.sel->get_index(ridx);
|
|
42602
42621
|
const auto &entry = ldata[lidx];
|
|
42603
|
-
if (idata.validity.RowIsValid(lidx)) {
|
|
42604
|
-
|
|
42605
|
-
|
|
42606
|
-
|
|
42622
|
+
if (idata.validity.RowIsValid(lidx) && entry.length > 0) {
|
|
42623
|
+
unprocessed.set_index(remaining++, ridx);
|
|
42624
|
+
cursor.set_index(ridx, entry.offset);
|
|
42625
|
+
} else if (FIRST_HASH) {
|
|
42626
|
+
hdata[ridx] = HashOp::NULL_HASH;
|
|
42627
|
+
}
|
|
42628
|
+
// Empty or NULL non-first elements have no effect.
|
|
42629
|
+
}
|
|
42630
|
+
|
|
42631
|
+
count = remaining;
|
|
42632
|
+
if (count == 0) {
|
|
42633
|
+
return;
|
|
42634
|
+
}
|
|
42635
|
+
|
|
42636
|
+
// Merge the first position hash into the main hash
|
|
42637
|
+
idx_t position = 1;
|
|
42638
|
+
if (FIRST_HASH) {
|
|
42639
|
+
remaining = 0;
|
|
42640
|
+
for (idx_t i = 0; i < count; ++i) {
|
|
42641
|
+
const auto ridx = unprocessed.get_index(i);
|
|
42642
|
+
const auto cidx = cursor.get_index(ridx);
|
|
42643
|
+
hdata[ridx] = chdata[cidx];
|
|
42644
|
+
|
|
42645
|
+
const auto lidx = idata.sel->get_index(ridx);
|
|
42646
|
+
const auto &entry = ldata[lidx];
|
|
42647
|
+
if (entry.length > position) {
|
|
42648
|
+
// Entry still has values to hash
|
|
42649
|
+
unprocessed.set_index(remaining++, ridx);
|
|
42650
|
+
cursor.set_index(ridx, cidx + 1);
|
|
42651
|
+
}
|
|
42652
|
+
}
|
|
42653
|
+
count = remaining;
|
|
42654
|
+
if (count == 0) {
|
|
42655
|
+
return;
|
|
42656
|
+
}
|
|
42657
|
+
++position;
|
|
42658
|
+
}
|
|
42659
|
+
|
|
42660
|
+
// Combine the hashes for the remaining positions until there are none left
|
|
42661
|
+
for (;; ++position) {
|
|
42662
|
+
remaining = 0;
|
|
42663
|
+
for (idx_t i = 0; i < count; ++i) {
|
|
42664
|
+
const auto ridx = unprocessed.get_index(i);
|
|
42665
|
+
const auto cidx = cursor.get_index(ridx);
|
|
42666
|
+
hdata[ridx] = CombineHashScalar(hdata[ridx], chdata[cidx]);
|
|
42667
|
+
|
|
42668
|
+
const auto lidx = idata.sel->get_index(ridx);
|
|
42669
|
+
const auto &entry = ldata[lidx];
|
|
42670
|
+
if (entry.length > position) {
|
|
42671
|
+
// Entry still has values to hash
|
|
42672
|
+
unprocessed.set_index(remaining++, ridx);
|
|
42673
|
+
cursor.set_index(ridx, cidx + 1);
|
|
42674
|
+
}
|
|
42675
|
+
}
|
|
42676
|
+
|
|
42677
|
+
count = remaining;
|
|
42678
|
+
if (count == 0) {
|
|
42679
|
+
break;
|
|
42607
42680
|
}
|
|
42608
42681
|
}
|
|
42609
42682
|
}
|
|
@@ -42672,10 +42745,6 @@ void VectorOperations::Hash(Vector &input, Vector &result, const SelectionVector
|
|
|
42672
42745
|
HashTypeSwitch<true>(input, result, &sel, count);
|
|
42673
42746
|
}
|
|
42674
42747
|
|
|
42675
|
-
static inline hash_t CombineHashScalar(hash_t a, hash_t b) {
|
|
42676
|
-
return (a * UINT64_C(0xbf58476d1ce4e5b9)) ^ b;
|
|
42677
|
-
}
|
|
42678
|
-
|
|
42679
42748
|
template <bool HAS_RSEL, class T>
|
|
42680
42749
|
static inline void TightLoopCombineHashConstant(T *__restrict ldata, hash_t constant_hash, hash_t *__restrict hash_data,
|
|
42681
42750
|
const SelectionVector *rsel, idx_t count,
|
|
@@ -80230,6 +80299,10 @@ struct AliasFun {
|
|
|
80230
80299
|
static void RegisterFunction(BuiltinFunctions &set);
|
|
80231
80300
|
};
|
|
80232
80301
|
|
|
80302
|
+
struct HashFun {
|
|
80303
|
+
static void RegisterFunction(BuiltinFunctions &set);
|
|
80304
|
+
};
|
|
80305
|
+
|
|
80233
80306
|
struct LeastFun {
|
|
80234
80307
|
static void RegisterFunction(BuiltinFunctions &set);
|
|
80235
80308
|
};
|
|
@@ -80431,6 +80504,21 @@ void CurrentSettingFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
80431
80504
|
} // namespace duckdb
|
|
80432
80505
|
|
|
80433
80506
|
|
|
80507
|
+
namespace duckdb {
|
|
80508
|
+
|
|
80509
|
+
static void HashFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
80510
|
+
args.Hash(result);
|
|
80511
|
+
}
|
|
80512
|
+
|
|
80513
|
+
void HashFun::RegisterFunction(BuiltinFunctions &set) {
|
|
80514
|
+
auto hash_fun = ScalarFunction("hash", {LogicalType::ANY}, LogicalType::HASH, HashFunction);
|
|
80515
|
+
hash_fun.varargs = LogicalType::ANY;
|
|
80516
|
+
set.AddFunction(hash_fun);
|
|
80517
|
+
}
|
|
80518
|
+
|
|
80519
|
+
} // namespace duckdb
|
|
80520
|
+
|
|
80521
|
+
|
|
80434
80522
|
|
|
80435
80523
|
namespace duckdb {
|
|
80436
80524
|
|
|
@@ -80631,6 +80719,7 @@ namespace duckdb {
|
|
|
80631
80719
|
|
|
80632
80720
|
void BuiltinFunctions::RegisterGenericFunctions() {
|
|
80633
80721
|
Register<AliasFun>();
|
|
80722
|
+
Register<HashFun>();
|
|
80634
80723
|
Register<LeastFun>();
|
|
80635
80724
|
Register<GreatestFun>();
|
|
80636
80725
|
Register<StatsFun>();
|
|
@@ -101749,35 +101838,35 @@ void DuckDB::SetExtensionLoaded(const std::string &name) {
|
|
|
101749
101838
|
|
|
101750
101839
|
|
|
101751
101840
|
|
|
101752
|
-
#
|
|
101841
|
+
#if defined(BUILD_ICU_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101753
101842
|
#include "icu-extension.hpp"
|
|
101754
101843
|
#endif
|
|
101755
101844
|
|
|
101756
|
-
#
|
|
101845
|
+
#if defined(BUILD_PARQUET_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101757
101846
|
#include "parquet-extension.hpp"
|
|
101758
101847
|
#endif
|
|
101759
101848
|
|
|
101760
|
-
#
|
|
101849
|
+
#if defined(BUILD_TPCH_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101761
101850
|
#include "tpch-extension.hpp"
|
|
101762
101851
|
#endif
|
|
101763
101852
|
|
|
101764
|
-
#
|
|
101853
|
+
#if defined(BUILD_TPCDS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101765
101854
|
#include "tpcds-extension.hpp"
|
|
101766
101855
|
#endif
|
|
101767
101856
|
|
|
101768
|
-
#
|
|
101857
|
+
#if defined(BUILD_FTS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101769
101858
|
#include "fts-extension.hpp"
|
|
101770
101859
|
#endif
|
|
101771
101860
|
|
|
101772
|
-
#
|
|
101861
|
+
#if defined(BUILD_HTTPFS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101773
101862
|
#include "httpfs-extension.hpp"
|
|
101774
101863
|
#endif
|
|
101775
101864
|
|
|
101776
|
-
#
|
|
101865
|
+
#if defined(BUILD_VISUALIZER_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101777
101866
|
#include "visualizer-extension.hpp"
|
|
101778
101867
|
#endif
|
|
101779
101868
|
|
|
101780
|
-
#
|
|
101869
|
+
#if defined(BUILD_EXCEL_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101781
101870
|
#include "excel-extension.hpp"
|
|
101782
101871
|
#endif
|
|
101783
101872
|
|
|
@@ -101816,55 +101905,55 @@ ExtensionLoadResult ExtensionHelper::LoadExtensionInternal(DuckDB &db, const std
|
|
|
101816
101905
|
}
|
|
101817
101906
|
#endif
|
|
101818
101907
|
if (extension == "parquet") {
|
|
101819
|
-
#
|
|
101908
|
+
#if defined(BUILD_PARQUET_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101820
101909
|
db.LoadExtension<ParquetExtension>();
|
|
101821
101910
|
#else
|
|
101822
101911
|
// parquet extension required but not build: skip this test
|
|
101823
101912
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101824
101913
|
#endif
|
|
101825
101914
|
} else if (extension == "icu") {
|
|
101826
|
-
#
|
|
101915
|
+
#if defined(BUILD_ICU_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101827
101916
|
db.LoadExtension<ICUExtension>();
|
|
101828
101917
|
#else
|
|
101829
101918
|
// icu extension required but not build: skip this test
|
|
101830
101919
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101831
101920
|
#endif
|
|
101832
101921
|
} else if (extension == "tpch") {
|
|
101833
|
-
#
|
|
101922
|
+
#if defined(BUILD_TPCH_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101834
101923
|
db.LoadExtension<TPCHExtension>();
|
|
101835
101924
|
#else
|
|
101836
101925
|
// icu extension required but not build: skip this test
|
|
101837
101926
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101838
101927
|
#endif
|
|
101839
101928
|
} else if (extension == "tpcds") {
|
|
101840
|
-
#
|
|
101929
|
+
#if defined(BUILD_TPCDS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101841
101930
|
db.LoadExtension<TPCDSExtension>();
|
|
101842
101931
|
#else
|
|
101843
101932
|
// icu extension required but not build: skip this test
|
|
101844
101933
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101845
101934
|
#endif
|
|
101846
101935
|
} else if (extension == "fts") {
|
|
101847
|
-
#
|
|
101936
|
+
#if defined(BUILD_FTS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101848
101937
|
db.LoadExtension<FTSExtension>();
|
|
101849
101938
|
#else
|
|
101850
101939
|
// fts extension required but not build: skip this test
|
|
101851
101940
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101852
101941
|
#endif
|
|
101853
101942
|
} else if (extension == "httpfs") {
|
|
101854
|
-
#
|
|
101943
|
+
#if defined(BUILD_HTTPFS_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101855
101944
|
db.LoadExtension<HTTPFsExtension>();
|
|
101856
101945
|
#else
|
|
101857
101946
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101858
101947
|
#endif
|
|
101859
101948
|
} else if (extension == "visualizer") {
|
|
101860
|
-
#
|
|
101949
|
+
#if defined(BUILD_VISUALIZER_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101861
101950
|
db.LoadExtension<VisualizerExtension>();
|
|
101862
101951
|
#else
|
|
101863
101952
|
// visualizer extension required but not build: skip this test
|
|
101864
101953
|
return ExtensionLoadResult::NOT_LOADED;
|
|
101865
101954
|
#endif
|
|
101866
101955
|
} else if (extension == "excel") {
|
|
101867
|
-
#
|
|
101956
|
+
#if defined(BUILD_EXCEL_EXTENSION) && !defined(DISABLE_BUILTIN_EXTENSIONS)
|
|
101868
101957
|
db.LoadExtension<EXCELExtension>();
|
|
101869
101958
|
#else
|
|
101870
101959
|
// excel extension required but not build: skip this test
|
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 "v0.3.3-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "2230af054"
|
|
15
|
+
#define DUCKDB_VERSION "v0.3.3-dev149"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|