duckdb 0.3.3-dev1350.0 → 0.3.3-dev1371.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/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 "9d561d4d9"
15
- #define DUCKDB_VERSION "v0.3.3-dev1350"
14
+ #define DUCKDB_SOURCE_ID "85bc5500c"
15
+ #define DUCKDB_VERSION "v0.3.3-dev1371"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -6463,7 +6463,8 @@ public:
6463
6463
  class BaseScalarFunction : public SimpleFunction {
6464
6464
  public:
6465
6465
  DUCKDB_API BaseScalarFunction(string name, vector<LogicalType> arguments, LogicalType return_type,
6466
- bool has_side_effects, LogicalType varargs = LogicalType(LogicalTypeId::INVALID));
6466
+ bool has_side_effects, LogicalType varargs = LogicalType(LogicalTypeId::INVALID),
6467
+ bool propagates_null_values = false);
6467
6468
  DUCKDB_API ~BaseScalarFunction() override;
6468
6469
 
6469
6470
  //! Return type of the function
@@ -6471,6 +6472,8 @@ public:
6471
6472
  //! Whether or not the function has side effects (e.g. sequence increments, random() functions, NOW()). Functions
6472
6473
  //! with side-effects cannot be constant-folded.
6473
6474
  bool has_side_effects;
6475
+ //! Whether or not the function propagates null values
6476
+ bool propagates_null_values;
6474
6477
 
6475
6478
  public:
6476
6479
  DUCKDB_API hash_t Hash() const;
@@ -7230,12 +7233,13 @@ public:
7230
7233
  scalar_function_t function, bool has_side_effects = false,
7231
7234
  bind_scalar_function_t bind = nullptr, dependency_function_t dependency = nullptr,
7232
7235
  function_statistics_t statistics = nullptr, init_local_state_t init_local_state = nullptr,
7233
- LogicalType varargs = LogicalType(LogicalTypeId::INVALID));
7236
+ LogicalType varargs = LogicalType(LogicalTypeId::INVALID),
7237
+ bool propagate_null_values = false);
7234
7238
 
7235
7239
  DUCKDB_API ScalarFunction(vector<LogicalType> arguments, LogicalType return_type, scalar_function_t function,
7236
- bool has_side_effects = false, bind_scalar_function_t bind = nullptr,
7237
- dependency_function_t dependency = nullptr, function_statistics_t statistics = nullptr,
7238
- init_local_state_t init_local_state = nullptr,
7240
+ bool propagate_null_values = false, bool has_side_effects = false,
7241
+ bind_scalar_function_t bind = nullptr, dependency_function_t dependency = nullptr,
7242
+ function_statistics_t statistics = nullptr, init_local_state_t init_local_state = nullptr,
7239
7243
  LogicalType varargs = LogicalType(LogicalTypeId::INVALID));
7240
7244
 
7241
7245
  //! The main scalar function to execute
@@ -8525,6 +8529,7 @@ public:
8525
8529
  bool IsScalar() const override;
8526
8530
  bool HasParameter() const override;
8527
8531
  virtual bool HasSideEffects() const;
8532
+ virtual bool PropagatesNullValues() const;
8528
8533
  virtual bool IsFoldable() const;
8529
8534
 
8530
8535
  hash_t Hash() const override;
@@ -8952,6 +8957,19 @@ typedef void (*aggregate_window_t)(Vector inputs[], FunctionData *bind_data, idx
8952
8957
 
8953
8958
  class AggregateFunction : public BaseScalarFunction {
8954
8959
  public:
8960
+ DUCKDB_API AggregateFunction(const string &name, const vector<LogicalType> &arguments,
8961
+ const LogicalType &return_type, aggregate_size_t state_size,
8962
+ aggregate_initialize_t initialize, aggregate_update_t update,
8963
+ aggregate_combine_t combine, aggregate_finalize_t finalize,
8964
+ bool propagates_null_values = false, aggregate_simple_update_t simple_update = nullptr,
8965
+ bind_aggregate_function_t bind = nullptr, aggregate_destructor_t destructor = nullptr,
8966
+ aggregate_statistics_t statistics = nullptr, aggregate_window_t window = nullptr)
8967
+ : BaseScalarFunction(name, arguments, return_type, false, LogicalType(LogicalTypeId::INVALID),
8968
+ propagates_null_values),
8969
+ state_size(state_size), initialize(initialize), update(update), combine(combine), finalize(finalize),
8970
+ simple_update(simple_update), window(window), bind(bind), destructor(destructor), statistics(statistics) {
8971
+ }
8972
+
8955
8973
  DUCKDB_API AggregateFunction(const string &name, const vector<LogicalType> &arguments,
8956
8974
  const LogicalType &return_type, aggregate_size_t state_size,
8957
8975
  aggregate_initialize_t initialize, aggregate_update_t update,
@@ -8959,21 +8977,30 @@ public:
8959
8977
  aggregate_simple_update_t simple_update = nullptr,
8960
8978
  bind_aggregate_function_t bind = nullptr, aggregate_destructor_t destructor = nullptr,
8961
8979
  aggregate_statistics_t statistics = nullptr, aggregate_window_t window = nullptr)
8962
- : BaseScalarFunction(name, arguments, return_type, false), state_size(state_size), initialize(initialize),
8963
- update(update), combine(combine), finalize(finalize), simple_update(simple_update), window(window),
8964
- bind(bind), destructor(destructor), statistics(statistics) {
8980
+ : BaseScalarFunction(name, arguments, return_type, false, LogicalType(LogicalTypeId::INVALID), false),
8981
+ state_size(state_size), initialize(initialize), update(update), combine(combine), finalize(finalize),
8982
+ simple_update(simple_update), window(window), bind(bind), destructor(destructor), statistics(statistics) {
8965
8983
  }
8966
8984
 
8967
8985
  DUCKDB_API AggregateFunction(const vector<LogicalType> &arguments, const LogicalType &return_type,
8968
8986
  aggregate_size_t state_size, aggregate_initialize_t initialize,
8969
8987
  aggregate_update_t update, aggregate_combine_t combine, aggregate_finalize_t finalize,
8970
- aggregate_simple_update_t simple_update = nullptr,
8988
+ bool propagates_null_values = false, aggregate_simple_update_t simple_update = nullptr,
8971
8989
  bind_aggregate_function_t bind = nullptr, aggregate_destructor_t destructor = nullptr,
8972
8990
  aggregate_statistics_t statistics = nullptr, aggregate_window_t window = nullptr)
8973
8991
  : AggregateFunction(string(), arguments, return_type, state_size, initialize, update, combine, finalize,
8974
- simple_update, bind, destructor, statistics, window) {
8992
+ propagates_null_values, simple_update, bind, destructor, statistics, window) {
8975
8993
  }
8976
8994
 
8995
+ DUCKDB_API AggregateFunction(const vector<LogicalType> &arguments, const LogicalType &return_type,
8996
+ aggregate_size_t state_size, aggregate_initialize_t initialize,
8997
+ aggregate_update_t update, aggregate_combine_t combine, aggregate_finalize_t finalize,
8998
+ aggregate_simple_update_t simple_update = nullptr,
8999
+ bind_aggregate_function_t bind = nullptr, aggregate_destructor_t destructor = nullptr,
9000
+ aggregate_statistics_t statistics = nullptr, aggregate_window_t window = nullptr)
9001
+ : AggregateFunction(string(), arguments, return_type, state_size, initialize, update, combine, finalize, false,
9002
+ simple_update, bind, destructor, statistics, window) {
9003
+ }
8977
9004
  //! The hashed aggregate state sizing function
8978
9005
  aggregate_size_t state_size;
8979
9006
  //! The hashed aggregate state initialization function
@@ -9025,12 +9052,13 @@ public:
9025
9052
  }
9026
9053
 
9027
9054
  template <class STATE, class INPUT_TYPE, class RESULT_TYPE, class OP>
9028
- static AggregateFunction UnaryAggregate(const LogicalType &input_type, LogicalType return_type) {
9055
+ static AggregateFunction UnaryAggregate(const LogicalType &input_type, LogicalType return_type,
9056
+ bool propagates_null_values = false) {
9029
9057
  return AggregateFunction(
9030
9058
  {input_type}, return_type, AggregateFunction::StateSize<STATE>,
9031
9059
  AggregateFunction::StateInitialize<STATE, OP>, AggregateFunction::UnaryScatterUpdate<STATE, INPUT_TYPE, OP>,
9032
9060
  AggregateFunction::StateCombine<STATE, OP>, AggregateFunction::StateFinalize<STATE, RESULT_TYPE, OP>,
9033
- AggregateFunction::UnaryUpdate<STATE, INPUT_TYPE, OP>);
9061
+ propagates_null_values, AggregateFunction::UnaryUpdate<STATE, INPUT_TYPE, OP>);
9034
9062
  }
9035
9063
 
9036
9064
  template <class STATE, class INPUT_TYPE, class RESULT_TYPE, class OP>
@@ -12133,6 +12161,7 @@ public:
12133
12161
  bool IsFoldable() const override {
12134
12162
  return false;
12135
12163
  }
12164
+ bool PropagatesNullValues() const override;
12136
12165
 
12137
12166
  string ToString() const override;
12138
12167
 
@@ -12368,6 +12397,8 @@ public:
12368
12397
 
12369
12398
  bool Equals(const BaseExpression *other) const override;
12370
12399
 
12400
+ bool PropagatesNullValues() const override;
12401
+
12371
12402
  unique_ptr<Expression> Copy() override;
12372
12403
  };
12373
12404
  } // namespace duckdb
@@ -12477,7 +12508,7 @@ public:
12477
12508
  bool HasSideEffects() const override;
12478
12509
  bool IsFoldable() const override;
12479
12510
  string ToString() const override;
12480
-
12511
+ bool PropagatesNullValues() const override;
12481
12512
  hash_t Hash() const override;
12482
12513
  bool Equals(const BaseExpression *other) const override;
12483
12514
 
@@ -14022,6 +14053,8 @@ public:
14022
14053
  bool Equals(const BaseExpression *other) const override;
14023
14054
 
14024
14055
  unique_ptr<Expression> Copy() override;
14056
+
14057
+ bool PropagatesNullValues() const override;
14025
14058
  };
14026
14059
  } // namespace duckdb
14027
14060