duckdb 0.3.3-dev1439.0 → 0.3.3-dev1441.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.3-dev1439.0",
4
+ "version": "0.3.3-dev1441.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -73190,7 +73190,6 @@ void ApproxCountDistinctFun::RegisterFunction(BuiltinFunctions &set) {
73190
73190
 
73191
73191
 
73192
73192
 
73193
- #include <utility>
73194
73193
 
73195
73194
  namespace duckdb {
73196
73195
 
@@ -73201,39 +73200,71 @@ struct ArgMinMaxState {
73201
73200
  bool is_initialized;
73202
73201
  };
73203
73202
 
73204
- struct ArgMinMaxOperation {
73205
- template <class STATE>
73206
- static void Initialize(STATE *state) {
73207
- state->is_initialized = false;
73203
+ template <class T>
73204
+ static void ArgMinMaxDestroyValue(T value) {
73205
+ }
73206
+
73207
+ template <>
73208
+ void ArgMinMaxDestroyValue(string_t value) {
73209
+ if (!value.IsInlined()) {
73210
+ delete[] value.GetDataUnsafe();
73208
73211
  }
73212
+ }
73209
73213
 
73210
- template <class T, class STATE>
73211
- static void Finalize(Vector &result, FunctionData *, STATE *state, T *target, ValidityMask &mask, idx_t idx) {
73212
- if (!state->is_initialized) {
73213
- mask.SetInvalid(idx);
73214
- } else {
73215
- target[idx] = state->arg;
73214
+ template <class T>
73215
+ static void ArgMinMaxAssignValue(T &target, T new_value, bool is_initialized) {
73216
+ target = new_value;
73217
+ }
73218
+
73219
+ template <>
73220
+ void ArgMinMaxAssignValue(string_t &target, string_t new_value, bool is_initialized) {
73221
+ if (is_initialized) {
73222
+ ArgMinMaxDestroyValue(target);
73223
+ }
73224
+ if (new_value.IsInlined()) {
73225
+ target = new_value;
73226
+ } else {
73227
+ // non-inlined string, need to allocate space for it
73228
+ auto len = new_value.GetSize();
73229
+ auto ptr = new char[len];
73230
+ memcpy(ptr, new_value.GetDataUnsafe(), len);
73231
+
73232
+ target = string_t(ptr, len);
73233
+ }
73234
+ }
73235
+
73236
+ template <class COMPARATOR>
73237
+ struct ArgMinMaxBase {
73238
+ template <class STATE>
73239
+ static void Destroy(STATE *state) {
73240
+ if (state->is_initialized) {
73241
+ ArgMinMaxDestroyValue(state->arg);
73242
+ ArgMinMaxDestroyValue(state->value);
73216
73243
  }
73217
73244
  }
73218
73245
 
73219
- static bool IgnoreNull() {
73220
- return true;
73246
+ template <class STATE>
73247
+ static void Initialize(STATE *state) {
73248
+ state->is_initialized = false;
73221
73249
  }
73222
- };
73223
73250
 
73224
- struct ArgMinOperation : ArgMinMaxOperation {
73225
73251
  template <class A_TYPE, class B_TYPE, class STATE, class OP>
73226
73252
  static void Operation(STATE *state, FunctionData *bind_data, A_TYPE *x_data, B_TYPE *y_data, ValidityMask &amask,
73227
73253
  ValidityMask &bmask, idx_t xidx, idx_t yidx) {
73228
73254
  if (!state->is_initialized) {
73229
- state->value = y_data[yidx];
73230
- state->arg = x_data[xidx];
73255
+ ArgMinMaxAssignValue<A_TYPE>(state->arg, x_data[xidx], false);
73256
+ ArgMinMaxAssignValue<B_TYPE>(state->value, y_data[yidx], false);
73231
73257
  state->is_initialized = true;
73232
73258
  } else {
73233
- if (y_data[yidx] < state->value) {
73234
- state->value = y_data[yidx];
73235
- state->arg = x_data[xidx];
73236
- }
73259
+ OP::template Execute<A_TYPE, B_TYPE, STATE>(state, x_data[xidx], y_data[yidx]);
73260
+ }
73261
+ }
73262
+
73263
+ template <class A_TYPE, class B_TYPE, class STATE>
73264
+ static void Execute(STATE *state, A_TYPE x_data, B_TYPE y_data) {
73265
+ if (COMPARATOR::Operation(y_data, state->value)) {
73266
+ ArgMinMaxAssignValue<A_TYPE>(state->arg, x_data, true);
73267
+ ArgMinMaxAssignValue<B_TYPE>(state->value, y_data, true);
73237
73268
  }
73238
73269
  }
73239
73270
 
@@ -73242,183 +73273,98 @@ struct ArgMinOperation : ArgMinMaxOperation {
73242
73273
  if (!source.is_initialized) {
73243
73274
  return;
73244
73275
  }
73245
- if (!target->is_initialized) {
73276
+ if (!target->is_initialized || COMPARATOR::Operation(source.value, target->value)) {
73277
+ ArgMinMaxAssignValue(target->arg, source.arg, target->is_initialized);
73278
+ ArgMinMaxAssignValue(target->value, source.value, target->is_initialized);
73246
73279
  target->is_initialized = true;
73247
- target->value = source.value;
73248
- target->arg = source.arg;
73249
- return;
73250
- }
73251
- if (source.value < target->value) {
73252
- target->value = source.value;
73253
- target->arg = source.arg;
73254
73280
  }
73255
73281
  }
73282
+
73283
+ static bool IgnoreNull() {
73284
+ return true;
73285
+ }
73256
73286
  };
73257
73287
 
73258
- struct ArgMaxOperation : ArgMinMaxOperation {
73259
- template <class A_TYPE, class B_TYPE, class STATE, class OP>
73260
- static void Operation(STATE *state, FunctionData *bind_data, A_TYPE *x_data, B_TYPE *y_data, ValidityMask &amask,
73261
- ValidityMask &bmask, idx_t xidx, idx_t yidx) {
73288
+ template <class COMPARATOR>
73289
+ struct StringArgMinMax : public ArgMinMaxBase<COMPARATOR> {
73290
+ template <class T, class STATE>
73291
+ static void Finalize(Vector &result, FunctionData *, STATE *state, T *target, ValidityMask &mask, idx_t idx) {
73262
73292
  if (!state->is_initialized) {
73263
- state->value = y_data[yidx];
73264
- state->arg = x_data[xidx];
73265
- state->is_initialized = true;
73293
+ mask.SetInvalid(idx);
73266
73294
  } else {
73267
- if (state->value < y_data[yidx]) {
73268
- state->value = y_data[yidx];
73269
- state->arg = x_data[xidx];
73270
- }
73295
+ target[idx] = StringVector::AddStringOrBlob(result, state->arg);
73271
73296
  }
73272
73297
  }
73298
+ };
73273
73299
 
73274
- template <class STATE, class OP>
73275
- static void Combine(const STATE &source, STATE *target) {
73276
- if (!source.is_initialized) {
73277
- return;
73278
- }
73279
- if (!target->is_initialized) {
73280
- target->is_initialized = true;
73281
- target->value = source.value;
73282
- target->arg = source.arg;
73283
- return;
73284
- }
73285
- if (target->value < source.value) {
73286
- target->value = source.value;
73287
- target->arg = source.arg;
73300
+ template <class COMPARATOR>
73301
+ struct NumericArgMinMax : public ArgMinMaxBase<COMPARATOR> {
73302
+ template <class T, class STATE>
73303
+ static void Finalize(Vector &result, FunctionData *, STATE *state, T *target, ValidityMask &mask, idx_t idx) {
73304
+ if (!state->is_initialized) {
73305
+ mask.SetInvalid(idx);
73306
+ } else {
73307
+ target[idx] = state->arg;
73288
73308
  }
73289
73309
  }
73290
73310
  };
73291
73311
 
73312
+ using NumericArgMinOperation = NumericArgMinMax<LessThan>;
73313
+ using NumericArgMaxOperation = NumericArgMinMax<GreaterThan>;
73314
+ using StringArgMinOperation = StringArgMinMax<LessThan>;
73315
+ using StringArgMaxOperation = StringArgMinMax<GreaterThan>;
73316
+
73317
+ template <class OP, class T, class T2>
73318
+ AggregateFunction GetArgMinMaxFunctionInternal(const LogicalType &arg_2, const LogicalType &arg) {
73319
+ auto function = AggregateFunction::BinaryAggregate<ArgMinMaxState<T, T2>, T, T2, T, OP>(arg, arg_2, arg);
73320
+ if (arg.InternalType() == PhysicalType::VARCHAR || arg_2.InternalType() == PhysicalType::VARCHAR) {
73321
+ function.destructor = AggregateFunction::StateDestroy<ArgMinMaxState<T, T2>, OP>;
73322
+ }
73323
+ return function;
73324
+ }
73292
73325
  template <class OP, class T>
73293
- AggregateFunction GetArgMinMaxFunctionArg2(LogicalTypeId arg_2, const LogicalType &arg) {
73294
- switch (arg_2) {
73295
- case LogicalTypeId::INTEGER:
73296
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, int32_t>, T, int32_t, T, OP>(
73297
- arg, LogicalType::INTEGER, arg);
73298
- case LogicalTypeId::BIGINT:
73299
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, int64_t>, T, int64_t, T, OP>(
73300
- arg, LogicalType::BIGINT, arg);
73301
- case LogicalTypeId::DOUBLE:
73302
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, double>, T, double, T, OP>(arg, LogicalType::DOUBLE,
73303
- arg);
73304
- case LogicalTypeId::VARCHAR:
73305
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, string_t>, T, string_t, T, OP>(
73306
- arg, LogicalType::VARCHAR, arg);
73307
- case LogicalTypeId::DATE:
73308
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, date_t>, T, date_t, T, OP>(arg, LogicalType::DATE,
73309
- arg);
73310
- case LogicalTypeId::TIMESTAMP:
73311
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, timestamp_t>, T, timestamp_t, T, OP>(
73312
- arg, LogicalType::TIMESTAMP, arg);
73313
- case LogicalTypeId::TIMESTAMP_TZ:
73314
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, timestamp_t>, T, timestamp_t, T, OP>(
73315
- arg, LogicalType::TIMESTAMP_TZ, arg);
73316
- case LogicalTypeId::BLOB:
73317
- return AggregateFunction::BinaryAggregate<ArgMinMaxState<T, string_t>, T, string_t, T, OP>(
73318
- arg, LogicalType::BLOB, arg);
73326
+ AggregateFunction GetArgMinMaxFunctionArg2(const LogicalType &arg_2, const LogicalType &arg) {
73327
+ switch (arg_2.InternalType()) {
73328
+ case PhysicalType::INT32:
73329
+ return GetArgMinMaxFunctionInternal<OP, T, int32_t>(arg_2, arg);
73330
+ case PhysicalType::INT64:
73331
+ return GetArgMinMaxFunctionInternal<OP, T, int64_t>(arg_2, arg);
73332
+ case PhysicalType::DOUBLE:
73333
+ return GetArgMinMaxFunctionInternal<OP, T, double>(arg_2, arg);
73334
+ case PhysicalType::VARCHAR:
73335
+ return GetArgMinMaxFunctionInternal<OP, T, string_t>(arg_2, arg);
73319
73336
  default:
73320
73337
  throw InternalException("Unimplemented arg_min/arg_max aggregate");
73321
73338
  }
73322
73339
  }
73323
73340
 
73324
- template <class OP>
73325
- void GetArgMinMaxFunction(LogicalTypeId arg_1, AggregateFunctionSet &fun) {
73326
- switch (arg_1) {
73327
- case LogicalTypeId::INTEGER:
73328
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::INTEGER, LogicalType::INTEGER));
73329
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::BIGINT, LogicalType::INTEGER));
73330
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::DOUBLE, LogicalType::INTEGER));
73331
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::VARCHAR, LogicalType::INTEGER));
73332
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::DATE, LogicalType::INTEGER));
73333
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::TIMESTAMP, LogicalType::INTEGER));
73334
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::INTEGER));
73335
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int32_t>(LogicalTypeId::BLOB, LogicalType::INTEGER));
73336
- break;
73337
- case LogicalTypeId::BIGINT:
73338
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::INTEGER, LogicalType::BIGINT));
73339
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::BIGINT, LogicalType::BIGINT));
73340
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::DOUBLE, LogicalType::BIGINT));
73341
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::VARCHAR, LogicalType::BIGINT));
73342
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::DATE, LogicalType::BIGINT));
73343
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::TIMESTAMP, LogicalType::BIGINT));
73344
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::BIGINT));
73345
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, int64_t>(LogicalTypeId::BLOB, LogicalType::BIGINT));
73346
- break;
73347
- case LogicalTypeId::DOUBLE:
73348
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::INTEGER, LogicalType::DOUBLE));
73349
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::BIGINT, LogicalType::DOUBLE));
73350
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::DOUBLE, LogicalType::DOUBLE));
73351
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::VARCHAR, LogicalType::DOUBLE));
73352
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::DATE, LogicalType::DOUBLE));
73353
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::TIMESTAMP, LogicalType::DOUBLE));
73354
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::DOUBLE));
73355
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, double>(LogicalTypeId::BLOB, LogicalType::DOUBLE));
73356
- break;
73357
- case LogicalTypeId::VARCHAR:
73358
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::INTEGER, LogicalType::VARCHAR));
73359
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::BIGINT, LogicalType::VARCHAR));
73360
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::DOUBLE, LogicalType::VARCHAR));
73361
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::VARCHAR, LogicalType::VARCHAR));
73362
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::DATE, LogicalType::VARCHAR));
73363
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::TIMESTAMP, LogicalType::VARCHAR));
73364
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::VARCHAR));
73365
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::BLOB, LogicalType::VARCHAR));
73366
- break;
73367
- case LogicalTypeId::DATE:
73368
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::INTEGER, LogicalType::DATE));
73369
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::BIGINT, LogicalType::DATE));
73370
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::DOUBLE, LogicalType::DATE));
73371
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::VARCHAR, LogicalType::DATE));
73372
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::DATE, LogicalType::DATE));
73373
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::TIMESTAMP, LogicalType::DATE));
73374
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::DATE));
73375
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, date_t>(LogicalTypeId::BLOB, LogicalType::DATE));
73376
- break;
73377
- case LogicalTypeId::TIMESTAMP:
73378
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::INTEGER, LogicalType::TIMESTAMP));
73379
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::BIGINT, LogicalType::TIMESTAMP));
73380
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::DOUBLE, LogicalType::TIMESTAMP));
73381
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::VARCHAR, LogicalType::TIMESTAMP));
73382
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::DATE, LogicalType::TIMESTAMP));
73383
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::TIMESTAMP, LogicalType::TIMESTAMP));
73384
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::TIMESTAMP));
73385
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::BLOB, LogicalType::TIMESTAMP));
73386
- break;
73387
- case LogicalTypeId::TIMESTAMP_TZ:
73388
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::INTEGER, LogicalType::TIMESTAMP_TZ));
73389
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::BIGINT, LogicalType::TIMESTAMP_TZ));
73390
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::DOUBLE, LogicalType::TIMESTAMP_TZ));
73391
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::VARCHAR, LogicalType::TIMESTAMP_TZ));
73392
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::DATE, LogicalType::TIMESTAMP_TZ));
73393
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::TIMESTAMP, LogicalType::TIMESTAMP_TZ));
73394
- fun.AddFunction(
73395
- GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::TIMESTAMP_TZ));
73396
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, timestamp_t>(LogicalTypeId::BLOB, LogicalType::TIMESTAMP_TZ));
73397
- break;
73398
- case LogicalTypeId::BLOB:
73399
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::INTEGER, LogicalType::BLOB));
73400
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::BIGINT, LogicalType::BLOB));
73401
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::DOUBLE, LogicalType::BLOB));
73402
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::VARCHAR, LogicalType::BLOB));
73403
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::DATE, LogicalType::BLOB));
73404
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::TIMESTAMP, LogicalType::BLOB));
73405
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::TIMESTAMP_TZ, LogicalType::BLOB));
73406
- fun.AddFunction(GetArgMinMaxFunctionArg2<OP, string_t>(LogicalTypeId::BLOB, LogicalType::BLOB));
73407
- break;
73408
- default:
73409
- throw InternalException("Unimplemented arg_min/arg_max aggregate");
73410
- }
73341
+ template <class OP, class T>
73342
+ void AddArgMinMaxFunctionArg2(AggregateFunctionSet &fun, const LogicalType &arg) {
73343
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::INTEGER, arg));
73344
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::BIGINT, arg));
73345
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::DOUBLE, arg));
73346
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::VARCHAR, arg));
73347
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::DATE, arg));
73348
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::TIMESTAMP, arg));
73349
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::TIMESTAMP_TZ, arg));
73350
+ fun.AddFunction(GetArgMinMaxFunctionArg2<OP, T>(LogicalType::BLOB, arg));
73351
+ }
73352
+
73353
+ template <class OP, class STRING_OP>
73354
+ static void AddArgMinMaxFunctions(AggregateFunctionSet &fun) {
73355
+ AddArgMinMaxFunctionArg2<OP, int32_t>(fun, LogicalType::INTEGER);
73356
+ AddArgMinMaxFunctionArg2<OP, int64_t>(fun, LogicalType::BIGINT);
73357
+ AddArgMinMaxFunctionArg2<OP, double>(fun, LogicalType::DOUBLE);
73358
+ AddArgMinMaxFunctionArg2<STRING_OP, string_t>(fun, LogicalType::VARCHAR);
73359
+ AddArgMinMaxFunctionArg2<OP, date_t>(fun, LogicalType::DATE);
73360
+ AddArgMinMaxFunctionArg2<OP, timestamp_t>(fun, LogicalType::TIMESTAMP);
73361
+ AddArgMinMaxFunctionArg2<OP, timestamp_t>(fun, LogicalType::TIMESTAMP_TZ);
73362
+ AddArgMinMaxFunctionArg2<STRING_OP, string_t>(fun, LogicalType::BLOB);
73411
73363
  }
73364
+
73412
73365
  void ArgMinFun::RegisterFunction(BuiltinFunctions &set) {
73413
73366
  AggregateFunctionSet fun("argmin");
73414
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::INTEGER, fun);
73415
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::BIGINT, fun);
73416
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::DOUBLE, fun);
73417
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::VARCHAR, fun);
73418
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::DATE, fun);
73419
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::TIMESTAMP, fun);
73420
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::TIMESTAMP_TZ, fun);
73421
- GetArgMinMaxFunction<ArgMinOperation>(LogicalTypeId::BLOB, fun);
73367
+ AddArgMinMaxFunctions<NumericArgMinOperation, StringArgMinOperation>(fun);
73422
73368
  set.AddFunction(fun);
73423
73369
 
73424
73370
  //! Add min_by alias
@@ -73432,14 +73378,7 @@ void ArgMinFun::RegisterFunction(BuiltinFunctions &set) {
73432
73378
 
73433
73379
  void ArgMaxFun::RegisterFunction(BuiltinFunctions &set) {
73434
73380
  AggregateFunctionSet fun("argmax");
73435
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::INTEGER, fun);
73436
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::BIGINT, fun);
73437
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::DOUBLE, fun);
73438
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::VARCHAR, fun);
73439
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::DATE, fun);
73440
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::TIMESTAMP, fun);
73441
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::TIMESTAMP_TZ, fun);
73442
- GetArgMinMaxFunction<ArgMaxOperation>(LogicalTypeId::BLOB, fun);
73381
+ AddArgMinMaxFunctions<NumericArgMaxOperation, StringArgMaxOperation>(fun);
73443
73382
  set.AddFunction(fun);
73444
73383
 
73445
73384
  //! Add max_by alias
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 "31ae8ed9a"
15
- #define DUCKDB_VERSION "v0.3.3-dev1439"
14
+ #define DUCKDB_SOURCE_ID "eb19f35fa"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1441"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //