Skip to content

Commit ae0acda

Browse files
authored
Merge pull request #170 from duckdb/bump140
Bump to DuckDB 1.4
2 parents e5471e0 + 149e5ad commit ae0acda

File tree

1,366 files changed

+73508
-36285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,366 files changed

+73508
-36285
lines changed

.github/workflows/NodeJS.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,21 @@ jobs:
4141
name: node.js Linux
4242
runs-on: ubuntu-22.04
4343
needs: set-up-npm
44-
continue-on-error: ${{ matrix.node != '18' && matrix.node != '20' && matrix.node != '21' }}
44+
continue-on-error: ${{matrix.node != '20' }}
4545
env:
4646
TARGET_ARCH: ${{ matrix.target_arch }}
4747
DUCKDB_NODE_BUILD_CACHE: 0
4848
strategy:
4949
matrix:
5050
# node.js current support policy to be found at https://github.com/duckdb/duckdb-node/tree/main/#Supported-Node-versions
51-
node: [ '18', '20', '22', '23', '24']
51+
node: ['20', '22', '24']
5252
target_arch: [ x64, arm64 ]
5353
isRelease:
5454
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
5555
exclude:
56-
- isRelease: false
57-
node: 18
58-
target_arch: arm64
5956
- isRelease: false
6057
node: 20
6158
target_arch: arm64
62-
- isRelease: false
63-
node: 21
64-
target_arch: arm64
6559

6660
steps:
6761
- uses: actions/checkout@v3
@@ -109,17 +103,13 @@ jobs:
109103
name: node.js OSX arm64
110104
runs-on: macos-14
111105
needs: set-up-npm
112-
continue-on-error: ${{ matrix.node != '18' && matrix.node != '20' && matrix.node != '21' }}
106+
continue-on-error: ${{ matrix.node != '20' }}
113107
strategy:
114108
matrix:
115109
target_arch: [ arm64 ]
116-
node: [ '18', '20', '22', '23', '24']
110+
node: ['20', '22', '24']
117111
isRelease:
118112
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
119-
exclude:
120-
- isRelease: false
121-
node: 19
122-
# these older versions of NodeJS don't have M1 support
123113

124114
env:
125115
TARGET_ARCH: ${{ matrix.target_arch }}
@@ -160,11 +150,11 @@ jobs:
160150
name: node.js OSX x64
161151
runs-on: macos-13
162152
needs: set-up-npm
163-
continue-on-error: ${{ matrix.node != '18' && matrix.node != '20' && matrix.node != '21' }}
153+
continue-on-error: ${{ matrix.node != '20' }}
164154
strategy:
165155
matrix:
166156
target_arch: [ x64 ]
167-
node: [ '18', '20', '22', '23', '24']
157+
node: ['20', '22', '24']
168158
isRelease:
169159
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
170160
env:
@@ -206,18 +196,16 @@ jobs:
206196
name: node.js Windows
207197
runs-on: windows-latest
208198
needs: set-up-npm
209-
continue-on-error: ${{ matrix.node != '18' && matrix.node != '20' && matrix.node != '21' }}
199+
continue-on-error: ${{ matrix.node != '20' }}
210200
env:
211201
npm_config_msvs_version: 2019
212202

213203
strategy:
214204
matrix:
215-
node: [ '18', '20', '22', '23', '24']
205+
node: ['20', '22', '24']
216206
isRelease:
217207
- ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
218208
exclude:
219-
- isRelease: false
220-
node: 18
221209
- isRelease: false
222210
node: 20
223211

binding.gyp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"src/duckdb/ub_src_common_row_operations.cpp",
2828
"src/duckdb/ub_src_common_serializer.cpp",
2929
"src/duckdb/ub_src_common_sort.cpp",
30+
"src/duckdb/ub_src_common_sorting.cpp",
3031
"src/duckdb/ub_src_common_tree_renderer.cpp",
3132
"src/duckdb/ub_src_common_types.cpp",
3233
"src/duckdb/ub_src_common_types_column.cpp",
@@ -71,6 +72,7 @@
7172
"src/duckdb/ub_src_function.cpp",
7273
"src/duckdb/ub_src_function_cast.cpp",
7374
"src/duckdb/ub_src_function_cast_union.cpp",
75+
"src/duckdb/ub_src_function_cast_variant.cpp",
7476
"src/duckdb/ub_src_function_pragma.cpp",
7577
"src/duckdb/ub_src_function_scalar_compressed_materialization.cpp",
7678
"src/duckdb/ub_src_function_scalar.cpp",
@@ -84,6 +86,7 @@
8486
"src/duckdb/ub_src_function_scalar_string_regexp.cpp",
8587
"src/duckdb/ub_src_function_scalar_struct.cpp",
8688
"src/duckdb/ub_src_function_scalar_system.cpp",
89+
"src/duckdb/ub_src_function_scalar_variant.cpp",
8790
"src/duckdb/ub_src_function_table_arrow.cpp",
8891
"src/duckdb/ub_src_function_table.cpp",
8992
"src/duckdb/ub_src_function_table_system.cpp",
@@ -99,7 +102,7 @@
99102
"src/duckdb/src/main/extension/extension_helper.cpp",
100103
"src/duckdb/src/main/extension/extension_install.cpp",
101104
"src/duckdb/src/main/extension/extension_load.cpp",
102-
"src/duckdb/src/main/extension/extension_util.cpp",
105+
"src/duckdb/src/main/extension/extension_loader.cpp",
103106
"src/duckdb/ub_src_main_http.cpp",
104107
"src/duckdb/ub_src_main_relation.cpp",
105108
"src/duckdb/ub_src_main_secret.cpp",
@@ -152,6 +155,7 @@
152155
"src/duckdb/ub_src_transaction.cpp",
153156
"src/duckdb/src/verification/copied_statement_verifier.cpp",
154157
"src/duckdb/src/verification/deserialized_statement_verifier.cpp",
158+
"src/duckdb/src/verification/explain_statement_verifier.cpp",
155159
"src/duckdb/src/verification/external_statement_verifier.cpp",
156160
"src/duckdb/src/verification/fetch_row_verifier.cpp",
157161
"src/duckdb/src/verification/no_operator_caching_verifier.cpp",
@@ -273,6 +277,7 @@
273277
"src/duckdb/extension/parquet/column_reader.cpp",
274278
"src/duckdb/extension/parquet/parquet_writer.cpp",
275279
"src/duckdb/ub_extension_parquet_reader.cpp",
280+
"src/duckdb/ub_extension_parquet_reader_variant.cpp",
276281
"src/duckdb/ub_extension_parquet_decoder.cpp",
277282
"src/duckdb/ub_extension_parquet_writer.cpp",
278283
"src/duckdb/third_party/parquet/parquet_types.cpp",
@@ -387,11 +392,14 @@
387392
"src/duckdb/third_party/mbedtls/library",
388393
"src/duckdb/third_party/miniz",
389394
"src/duckdb/third_party/pcg",
395+
"src/duckdb/third_party/pdqsort",
390396
"src/duckdb/third_party/re2",
397+
"src/duckdb/third_party/ska_sort",
391398
"src/duckdb/third_party/skiplist",
392399
"src/duckdb/third_party/tdigest",
393400
"src/duckdb/third_party/utf8proc",
394401
"src/duckdb/third_party/utf8proc/include",
402+
"src/duckdb/third_party/vergesort",
395403
"src/duckdb/third_party/yyjson/include",
396404
"src/duckdb/third_party/zstd/include",
397405
"src/duckdb/extension/parquet/include",

src/connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ struct ExecTask : public Task {
375375
break;
376376
}
377377
}
378-
} catch (duckdb::ParserException &e) {
378+
} catch (duckdb::Exception &e) {
379379
success = false;
380380
error = duckdb::ErrorData(e);
381381
return;

src/duckdb/extension/core_functions/aggregate/algebraic/avg.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace duckdb {
1010

11+
namespace {
12+
1113
template <class T>
1214
struct AvgState {
1315
uint64_t count;
@@ -275,6 +277,8 @@ unique_ptr<FunctionData> BindDecimalAvg(ClientContext &context, AggregateFunctio
275277
Hugeint::Cast<double>(Hugeint::POWERS_OF_TEN[DecimalType::GetScale(decimal_type)]));
276278
}
277279

280+
} // namespace
281+
278282
AggregateFunctionSet AvgFun::GetFunctions() {
279283
AggregateFunctionSet avg;
280284

src/duckdb/extension/core_functions/aggregate/distributive/approx_count.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace duckdb {
1111
// Algorithms from
1212
// "New cardinality estimation algorithms for HyperLogLog sketches"
1313
// Otmar Ertl, arXiv:1702.01284
14+
namespace {
15+
1416
struct ApproxDistinctCountState {
1517
HyperLogLog hll;
1618
};
@@ -36,8 +38,8 @@ struct ApproxCountDistinctFunction {
3638
}
3739
};
3840

39-
static void ApproxCountDistinctSimpleUpdateFunction(Vector inputs[], AggregateInputData &, idx_t input_count,
40-
data_ptr_t state, idx_t count) {
41+
void ApproxCountDistinctSimpleUpdateFunction(Vector inputs[], AggregateInputData &, idx_t input_count, data_ptr_t state,
42+
idx_t count) {
4143
D_ASSERT(input_count == 1);
4244
auto &input = inputs[0];
4345

@@ -51,8 +53,8 @@ static void ApproxCountDistinctSimpleUpdateFunction(Vector inputs[], AggregateIn
5153
agg_state->hll.Update(input, hash_vec, count);
5254
}
5355

54-
static void ApproxCountDistinctUpdateFunction(Vector inputs[], AggregateInputData &, idx_t input_count,
55-
Vector &state_vector, idx_t count) {
56+
void ApproxCountDistinctUpdateFunction(Vector inputs[], AggregateInputData &, idx_t input_count, Vector &state_vector,
57+
idx_t count) {
5658
D_ASSERT(input_count == 1);
5759
auto &input = inputs[0];
5860
UnifiedVectorFormat idata;
@@ -92,6 +94,8 @@ AggregateFunction GetApproxCountDistinctFunction(const LogicalType &input_type)
9294
return fun;
9395
}
9496

97+
} // namespace
98+
9599
AggregateFunction ApproxCountDistinctFun::GetFunction() {
96100
return GetApproxCountDistinctFunction(LogicalType::ANY);
97101
}

src/duckdb/extension/core_functions/aggregate/distributive/arg_min_max.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
namespace duckdb {
1414

15+
namespace {
16+
1517
struct ArgMinMaxStateBase {
1618
ArgMinMaxStateBase() : is_initialized(false), arg_null(false) {
1719
}
@@ -346,7 +348,7 @@ AggregateFunction GetVectorArgMinMaxFunctionBy(const LogicalType &by_type, const
346348
}
347349
#endif
348350

349-
static const vector<LogicalType> ArgMaxByTypes() {
351+
const vector<LogicalType> ArgMaxByTypes() {
350352
vector<LogicalType> types = {LogicalType::INTEGER, LogicalType::BIGINT, LogicalType::HUGEINT,
351353
LogicalType::DOUBLE, LogicalType::VARCHAR, LogicalType::DATE,
352354
LogicalType::TIMESTAMP, LogicalType::TIMESTAMP_TZ, LogicalType::BLOB};
@@ -417,7 +419,7 @@ void AddArgMinMaxFunctionBy(AggregateFunctionSet &fun, const LogicalType &type)
417419
}
418420

419421
template <class OP>
420-
static AggregateFunction GetDecimalArgMinMaxFunction(const LogicalType &by_type, const LogicalType &type) {
422+
AggregateFunction GetDecimalArgMinMaxFunction(const LogicalType &by_type, const LogicalType &type) {
421423
D_ASSERT(type.id() == LogicalTypeId::DECIMAL);
422424
#ifndef DUCKDB_SMALLER_BINARY
423425
switch (type.InternalType()) {
@@ -436,8 +438,8 @@ static AggregateFunction GetDecimalArgMinMaxFunction(const LogicalType &by_type,
436438
}
437439

438440
template <class OP>
439-
static unique_ptr<FunctionData> BindDecimalArgMinMax(ClientContext &context, AggregateFunction &function,
440-
vector<unique_ptr<Expression>> &arguments) {
441+
unique_ptr<FunctionData> BindDecimalArgMinMax(ClientContext &context, AggregateFunction &function,
442+
vector<unique_ptr<Expression>> &arguments) {
441443
auto decimal_type = arguments[0]->return_type;
442444
auto by_type = arguments[1]->return_type;
443445

@@ -453,7 +455,7 @@ static unique_ptr<FunctionData> BindDecimalArgMinMax(ClientContext &context, Agg
453455
break;
454456
}
455457

456-
auto cast_cost = CastFunctionSet::Get(context).ImplicitCastCost(by_type, by_types[i]);
458+
auto cast_cost = CastFunctionSet::ImplicitCastCost(context, by_type, by_types[i]);
457459
if (cast_cost < 0) {
458460
continue;
459461
}
@@ -485,7 +487,7 @@ void AddGenericArgMinMaxFunction(AggregateFunctionSet &fun) {
485487
}
486488

487489
template <class COMPARATOR, bool IGNORE_NULL, OrderType ORDER_TYPE>
488-
static void AddArgMinMaxFunctions(AggregateFunctionSet &fun) {
490+
void AddArgMinMaxFunctions(AggregateFunctionSet &fun) {
489491
using GENERIC_VECTOR_OP = VectorArgMinMaxBase<LessThan, IGNORE_NULL, ORDER_TYPE, GenericArgMinMaxState<ORDER_TYPE>>;
490492
#ifndef DUCKDB_SMALLER_BINARY
491493
using OP = ArgMinMaxBase<COMPARATOR, IGNORE_NULL>;
@@ -543,8 +545,8 @@ class ArgMinMaxNState {
543545
// Operation
544546
//------------------------------------------------------------------------------
545547
template <class STATE>
546-
static void ArgMinMaxNUpdate(Vector inputs[], AggregateInputData &aggr_input, idx_t input_count, Vector &state_vector,
547-
idx_t count) {
548+
void ArgMinMaxNUpdate(Vector inputs[], AggregateInputData &aggr_input, idx_t input_count, Vector &state_vector,
549+
idx_t count) {
548550

549551
auto &val_vector = inputs[0];
550552
auto &arg_vector = inputs[1];
@@ -604,7 +606,7 @@ static void ArgMinMaxNUpdate(Vector inputs[], AggregateInputData &aggr_input, id
604606
// Bind
605607
//------------------------------------------------------------------------------
606608
template <class VAL_TYPE, class ARG_TYPE, class COMPARATOR>
607-
static void SpecializeArgMinMaxNFunction(AggregateFunction &function) {
609+
void SpecializeArgMinMaxNFunction(AggregateFunction &function) {
608610
using STATE = ArgMinMaxNState<VAL_TYPE, ARG_TYPE, COMPARATOR>;
609611
using OP = MinMaxNOperation;
610612

@@ -618,7 +620,7 @@ static void SpecializeArgMinMaxNFunction(AggregateFunction &function) {
618620
}
619621

620622
template <class VAL_TYPE, class COMPARATOR>
621-
static void SpecializeArgMinMaxNFunction(PhysicalType arg_type, AggregateFunction &function) {
623+
void SpecializeArgMinMaxNFunction(PhysicalType arg_type, AggregateFunction &function) {
622624
switch (arg_type) {
623625
#ifndef DUCKDB_SMALLER_BINARY
624626
case PhysicalType::VARCHAR:
@@ -644,7 +646,7 @@ static void SpecializeArgMinMaxNFunction(PhysicalType arg_type, AggregateFunctio
644646
}
645647

646648
template <class COMPARATOR>
647-
static void SpecializeArgMinMaxNFunction(PhysicalType val_type, PhysicalType arg_type, AggregateFunction &function) {
649+
void SpecializeArgMinMaxNFunction(PhysicalType val_type, PhysicalType arg_type, AggregateFunction &function) {
648650
switch (val_type) {
649651
#ifndef DUCKDB_SMALLER_BINARY
650652
case PhysicalType::VARCHAR:
@@ -689,14 +691,16 @@ unique_ptr<FunctionData> ArgMinMaxNBind(ClientContext &context, AggregateFunctio
689691
}
690692

691693
template <class COMPARATOR>
692-
static void AddArgMinMaxNFunction(AggregateFunctionSet &set) {
694+
void AddArgMinMaxNFunction(AggregateFunctionSet &set) {
693695
AggregateFunction function({LogicalTypeId::ANY, LogicalTypeId::ANY, LogicalType::BIGINT},
694696
LogicalType::LIST(LogicalType::ANY), nullptr, nullptr, nullptr, nullptr, nullptr,
695697
nullptr, ArgMinMaxNBind<COMPARATOR>);
696698

697699
return set.AddFunction(function);
698700
}
699701

702+
} // namespace
703+
700704
//------------------------------------------------------------------------------
701705
// Function Registration
702706
//------------------------------------------------------------------------------

src/duckdb/extension/core_functions/aggregate/distributive/bitagg.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace duckdb {
1010

11+
namespace {
12+
1113
template <class T>
1214
struct BitState {
1315
using TYPE = T;
@@ -16,7 +18,7 @@ struct BitState {
1618
};
1719

1820
template <class OP>
19-
static AggregateFunction GetBitfieldUnaryAggregate(LogicalType type) {
21+
AggregateFunction GetBitfieldUnaryAggregate(LogicalType type) {
2022
switch (type.id()) {
2123
case LogicalTypeId::TINYINT:
2224
return AggregateFunction::UnaryAggregate<BitState<uint8_t>, int8_t, int8_t, OP>(type, type);
@@ -194,6 +196,8 @@ struct BitStringXorOperation : public BitStringBitwiseOperation {
194196
}
195197
};
196198

199+
} // namespace
200+
197201
AggregateFunctionSet BitAndFun::GetFunctions() {
198202
AggregateFunctionSet bit_and;
199203
for (auto &type : LogicalType::Integral()) {

src/duckdb/extension/core_functions/aggregate/distributive/bitstring_agg.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace duckdb {
1515

16+
namespace {
17+
1618
template <class INPUT_TYPE>
1719
struct BitAggState {
1820
bool is_set;
@@ -258,7 +260,7 @@ unique_ptr<FunctionData> BindBitstringAgg(ClientContext &context, AggregateFunct
258260
}
259261

260262
template <class TYPE>
261-
static void BindBitString(AggregateFunctionSet &bitstring_agg, const LogicalTypeId &type) {
263+
void BindBitString(AggregateFunctionSet &bitstring_agg, const LogicalTypeId &type) {
262264
auto function =
263265
AggregateFunction::UnaryAggregateDestructor<BitAggState<TYPE>, TYPE, string_t, BitStringAggOperation>(
264266
type, LogicalType::BIT);
@@ -309,6 +311,8 @@ void GetBitStringAggregate(const LogicalType &type, AggregateFunctionSet &bitstr
309311
}
310312
}
311313

314+
} // namespace
315+
312316
AggregateFunctionSet BitstringAggFun::GetFunctions() {
313317
AggregateFunctionSet bitstring_agg("bitstring_agg");
314318
for (auto &type : LogicalType::Integral()) {

src/duckdb/extension/core_functions/aggregate/distributive/bool.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace duckdb {
88

9+
namespace {
10+
911
struct BoolState {
1012
bool empty;
1113
bool val;
@@ -91,6 +93,8 @@ struct BoolOrFunFunction {
9193
}
9294
};
9395

96+
} // namespace
97+
9498
AggregateFunction BoolOrFun::GetFunction() {
9599
auto fun = AggregateFunction::UnaryAggregate<BoolState, bool, bool, BoolOrFunFunction>(
96100
LogicalType(LogicalTypeId::BOOLEAN), LogicalType::BOOLEAN);

0 commit comments

Comments
 (0)