duckdb 0.4.1-dev19.0 → 0.4.1-dev26.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.4.1-dev19.0",
4
+ "version": "0.4.1-dev26.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
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 &regex) {
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 {
@@ -73810,6 +73821,7 @@ public:
73810
73821
 
73811
73822
 
73812
73823
 
73824
+
73813
73825
  namespace duckdb {
73814
73826
 
73815
73827
  PhysicalCreateType::PhysicalCreateType(unique_ptr<CreateTypeInfo> info, idx_t estimated_cardinality)
@@ -91605,18 +91617,22 @@ void DateSubFun::RegisterFunction(BuiltinFunctions &set) {
91605
91617
 
91606
91618
 
91607
91619
 
91620
+
91608
91621
  namespace duckdb {
91609
91622
 
91610
91623
  struct DateTrunc {
91624
+ template <class TA, class TR, class OP>
91625
+ static inline TR UnaryFunction(TA input) {
91626
+ if (Value::IsFinite(input)) {
91627
+ return OP::template Operation<TA, TR>(input);
91628
+ } else {
91629
+ return Cast::template Operation<TA, TR>(input);
91630
+ }
91631
+ }
91632
+
91611
91633
  template <class TA, class TR, class OP>
91612
91634
  static inline void UnaryExecute(Vector &left, Vector &result, idx_t count) {
91613
- UnaryExecutor::Execute<TA, TR>(left, result, count, [&](TA input) {
91614
- if (Value::IsFinite(input)) {
91615
- return OP::template Operation<TA, TR>(input);
91616
- } else {
91617
- return Cast::template Operation<TA, TR>(input);
91618
- }
91619
- });
91635
+ UnaryExecutor::Execute<TA, TR>(left, result, count, UnaryFunction<TA, TR, OP>);
91620
91636
  }
91621
91637
 
91622
91638
  struct MillenniumOperator {
@@ -92179,6 +92195,82 @@ static void DateTruncFunction(DataChunk &args, ExpressionState &state, Vector &r
92179
92195
  }
92180
92196
  }
92181
92197
 
92198
+ template <class TA, class TR, class OP>
92199
+ static unique_ptr<BaseStatistics> DateTruncStatistics(vector<unique_ptr<BaseStatistics>> &child_stats) {
92200
+ // we can only propagate date stats if the child has stats
92201
+ if (!child_stats[1]) {
92202
+ return nullptr;
92203
+ }
92204
+ auto &nstats = (NumericStatistics &)*child_stats[1];
92205
+ if (nstats.min.IsNull() || nstats.max.IsNull()) {
92206
+ return nullptr;
92207
+ }
92208
+ // run the operator on both the min and the max, this gives us the [min, max] bound
92209
+ auto min = nstats.min.GetValueUnsafe<TA>();
92210
+ auto max = nstats.max.GetValueUnsafe<TA>();
92211
+ if (min > max) {
92212
+ throw InternalException("Invalid DATETRUNC child statistics");
92213
+ }
92214
+
92215
+ // Infinite values are unmodified
92216
+ auto min_part = DateTrunc::UnaryFunction<TA, TR, OP>(min);
92217
+ auto max_part = DateTrunc::UnaryFunction<TA, TR, OP>(max);
92218
+
92219
+ auto min_value = Value::CreateValue(min_part);
92220
+ auto max_value = Value::CreateValue(max_part);
92221
+ auto result = make_unique<NumericStatistics>(min_value.type(), min_value, max_value, StatisticsType::LOCAL_STATS);
92222
+ if (child_stats[0]->validity_stats) {
92223
+ result->validity_stats = child_stats[1]->validity_stats->Copy();
92224
+ }
92225
+ return move(result);
92226
+ }
92227
+
92228
+ template <class TA, class TR, class OP>
92229
+ static unique_ptr<BaseStatistics> PropagateDateTruncStatistics(ClientContext &context, FunctionStatisticsInput &input) {
92230
+ return DateTruncStatistics<TA, TR, OP>(input.child_stats);
92231
+ }
92232
+
92233
+ template <typename TA, typename TR>
92234
+ static function_statistics_t DateTruncStats(DatePartSpecifier type) {
92235
+ switch (type) {
92236
+ case DatePartSpecifier::MILLENNIUM:
92237
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::MillenniumOperator>;
92238
+ case DatePartSpecifier::CENTURY:
92239
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::CenturyOperator>;
92240
+ case DatePartSpecifier::DECADE:
92241
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::DecadeOperator>;
92242
+ case DatePartSpecifier::YEAR:
92243
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::YearOperator>;
92244
+ case DatePartSpecifier::QUARTER:
92245
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::QuarterOperator>;
92246
+ case DatePartSpecifier::MONTH:
92247
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::MonthOperator>;
92248
+ case DatePartSpecifier::WEEK:
92249
+ case DatePartSpecifier::YEARWEEK:
92250
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::WeekOperator>;
92251
+ case DatePartSpecifier::ISOYEAR:
92252
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::ISOYearOperator>;
92253
+ case DatePartSpecifier::DAY:
92254
+ case DatePartSpecifier::DOW:
92255
+ case DatePartSpecifier::ISODOW:
92256
+ case DatePartSpecifier::DOY:
92257
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::DayOperator>;
92258
+ case DatePartSpecifier::HOUR:
92259
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::HourOperator>;
92260
+ case DatePartSpecifier::MINUTE:
92261
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::MinuteOperator>;
92262
+ case DatePartSpecifier::SECOND:
92263
+ case DatePartSpecifier::EPOCH:
92264
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::SecondOperator>;
92265
+ case DatePartSpecifier::MILLISECONDS:
92266
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::MillisecondOperator>;
92267
+ case DatePartSpecifier::MICROSECONDS:
92268
+ return PropagateDateTruncStatistics<TA, TR, DateTrunc::MicrosecondOperator>;
92269
+ default:
92270
+ throw NotImplementedException("Specifier type not implemented for DATETRUNC statistics");
92271
+ }
92272
+ }
92273
+
92182
92274
  static unique_ptr<FunctionData> DateTruncBind(ClientContext &context, ScalarFunction &bound_function,
92183
92275
  vector<unique_ptr<Expression>> &arguments) {
92184
92276
  if (!arguments[0]->IsFoldable()) {
@@ -92209,9 +92301,11 @@ static unique_ptr<FunctionData> DateTruncBind(ClientContext &context, ScalarFunc
92209
92301
  switch (arguments[1]->return_type.id()) {
92210
92302
  case LogicalType::TIMESTAMP:
92211
92303
  bound_function.function = DateTruncFunction<timestamp_t, date_t>;
92304
+ bound_function.statistics = DateTruncStats<timestamp_t, date_t>(part_code);
92212
92305
  break;
92213
92306
  case LogicalType::DATE:
92214
92307
  bound_function.function = DateTruncFunction<date_t, date_t>;
92308
+ bound_function.statistics = DateTruncStats<date_t, date_t>(part_code);
92215
92309
  break;
92216
92310
  default:
92217
92311
  break;
@@ -92219,6 +92313,16 @@ static unique_ptr<FunctionData> DateTruncBind(ClientContext &context, ScalarFunc
92219
92313
  bound_function.return_type = LogicalType::DATE;
92220
92314
  break;
92221
92315
  default:
92316
+ switch (arguments[1]->return_type.id()) {
92317
+ case LogicalType::TIMESTAMP:
92318
+ bound_function.statistics = DateTruncStats<timestamp_t, timestamp_t>(part_code);
92319
+ break;
92320
+ case LogicalType::DATE:
92321
+ bound_function.statistics = DateTruncStats<timestamp_t, date_t>(part_code);
92322
+ break;
92323
+ default:
92324
+ break;
92325
+ }
92222
92326
  break;
92223
92327
  }
92224
92328
 
@@ -95014,6 +95118,7 @@ void ListPositionFun::RegisterFunction(BuiltinFunctions &set) {
95014
95118
  } // namespace duckdb
95015
95119
 
95016
95120
 
95121
+
95017
95122
  //===----------------------------------------------------------------------===//
95018
95123
  // DuckDB
95019
95124
  //
@@ -96431,6 +96536,7 @@ void ListSortFun::RegisterFunction(BuiltinFunctions &set) {
96431
96536
 
96432
96537
 
96433
96538
 
96539
+
96434
96540
  namespace duckdb {
96435
96541
 
96436
96542
  static void ListValueFunction(DataChunk &args, ExpressionState &state, Vector &result) {
@@ -114996,6 +115102,7 @@ private:
114996
115102
 
114997
115103
 
114998
115104
 
115105
+
114999
115106
  //===----------------------------------------------------------------------===//
115000
115107
  // DuckDB
115001
115108
  //
@@ -116514,6 +116621,7 @@ bool ClientContextFileOpener::TryGetCurrentSetting(const string &key, Value &res
116514
116621
 
116515
116622
 
116516
116623
 
116624
+
116517
116625
  namespace duckdb {
116518
116626
 
116519
116627
  ClientData::ClientData(ClientContext &context) : catalog_search_path(make_unique<CatalogSearchPath>(context)) {
@@ -132071,6 +132179,7 @@ private:
132071
132179
 
132072
132180
 
132073
132181
 
132182
+
132074
132183
  namespace duckdb {
132075
132184
 
132076
132185
  using ExpressionValueInformation = FilterCombiner::ExpressionValueInformation;
@@ -135624,6 +135733,7 @@ public:
135624
135733
 
135625
135734
  } // namespace duckdb
135626
135735
 
135736
+
135627
135737
  //===----------------------------------------------------------------------===//
135628
135738
  // DuckDB
135629
135739
  //
@@ -147305,6 +147415,7 @@ unique_ptr<ParsedExpression> BetweenExpression::Deserialize(ExpressionType type,
147305
147415
 
147306
147416
 
147307
147417
 
147418
+
147308
147419
  namespace duckdb {
147309
147420
 
147310
147421
  CaseExpression::CaseExpression() : ParsedExpression(ExpressionType::CASE_EXPR, ExpressionClass::CASE) {
@@ -148505,6 +148616,7 @@ string KeywordHelper::WriteOptionallyQuoted(const string &text, char quote) {
148505
148616
 
148506
148617
 
148507
148618
 
148619
+
148508
148620
  namespace duckdb {
148509
148621
 
148510
148622
  AlterInfo::AlterInfo(AlterType type, string schema_p, string name_p)
@@ -160035,6 +160147,7 @@ unique_ptr<AlterStatement> Transformer::TransformAlterSequence(duckdb_libpgquery
160035
160147
 
160036
160148
 
160037
160149
 
160150
+
160038
160151
  namespace duckdb {
160039
160152
 
160040
160153
  unique_ptr<AlterStatement> Transformer::TransformAlter(duckdb_libpgquery::PGNode *node) {
@@ -160752,6 +160865,7 @@ unique_ptr<CreateStatement> Transformer::TransformCreateType(duckdb_libpgquery::
160752
160865
 
160753
160866
 
160754
160867
 
160868
+
160755
160869
  namespace duckdb {
160756
160870
 
160757
160871
  unique_ptr<CreateStatement> Transformer::TransformCreateView(duckdb_libpgquery::PGNode *node) {
@@ -171258,6 +171372,7 @@ BindResult ColumnAliasBinder::BindAlias(ExpressionBinder &enclosing_binder, Colu
171258
171372
 
171259
171373
  } // namespace duckdb
171260
171374
 
171375
+
171261
171376
  namespace duckdb {
171262
171377
 
171263
171378
  ConstantBinder::ConstantBinder(Binder &binder, ClientContext &context, string clause)
@@ -174775,6 +174890,7 @@ public:
174775
174890
  #endif
174776
174891
 
174777
174892
 
174893
+
174778
174894
  namespace duckdb {
174779
174895
 
174780
174896
  BlockHandle::BlockHandle(DatabaseInstance &db, block_id_t block_id_p)
@@ -178533,6 +178649,7 @@ public:
178533
178649
 
178534
178650
 
178535
178651
 
178652
+
178536
178653
  namespace duckdb {
178537
178654
 
178538
178655
  struct StringHash {
@@ -179180,6 +179297,7 @@ bool DictionaryCompressionFun::TypeIsSupported(PhysicalType type) {
179180
179297
 
179181
179298
 
179182
179299
 
179300
+
179183
179301
  namespace duckdb {
179184
179302
 
179185
179303
  //===--------------------------------------------------------------------===//
@@ -188591,6 +188709,7 @@ struct UpdateInfo {
188591
188709
 
188592
188710
  } // namespace duckdb
188593
188711
 
188712
+
188594
188713
  namespace duckdb {
188595
188714
 
188596
188715
  static UpdateSegment::initialize_update_function_t GetInitializeUpdateFunction(PhysicalType type);
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 "6e4d98f9f"
15
- #define DUCKDB_VERSION "v0.4.1-dev19"
14
+ #define DUCKDB_SOURCE_ID "8e602ba1d"
15
+ #define DUCKDB_VERSION "v0.4.1-dev26"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -401,6 +401,7 @@ DUCKDB_API void DuckDBAssertInternal(bool condition, const char *condition_name,
401
401
 
402
402
  #endif
403
403
 
404
+
404
405
  //===----------------------------------------------------------------------===//
405
406
  // DuckDB
406
407
  //
@@ -10086,6 +10087,7 @@ private:
10086
10087
 
10087
10088
  } // namespace duckdb
10088
10089
 
10090
+
10089
10091
  namespace duckdb {
10090
10092
 
10091
10093
  class ClientContext;
@@ -10124,6 +10126,7 @@ public:
10124
10126
  };
10125
10127
 
10126
10128
  } // namespace duckdb
10129
+
10127
10130
  //===----------------------------------------------------------------------===//
10128
10131
  // DuckDB
10129
10132
  //
@@ -11264,6 +11267,7 @@ private:
11264
11267
 
11265
11268
  } // namespace duckdb
11266
11269
 
11270
+
11267
11271
  //===----------------------------------------------------------------------===//
11268
11272
  // DuckDB
11269
11273
  //
@@ -15358,6 +15362,7 @@ namespace duckdb {
15358
15362
  using std::deque;
15359
15363
  }
15360
15364
 
15365
+
15361
15366
  //===----------------------------------------------------------------------===//
15362
15367
  // DuckDB
15363
15368
  //
@@ -17435,6 +17440,7 @@ private:
17435
17440
 
17436
17441
 
17437
17442
 
17443
+
17438
17444
  //===----------------------------------------------------------------------===//
17439
17445
  // DuckDB
17440
17446
  //
@@ -17489,6 +17495,7 @@ private:
17489
17495
  };
17490
17496
 
17491
17497
  } // namespace duckdb
17498
+
17492
17499
  //===----------------------------------------------------------------------===//
17493
17500
  // DuckDB
17494
17501
  //
@@ -17697,6 +17704,7 @@ public:
17697
17704
 
17698
17705
  } // namespace duckdb
17699
17706
 
17707
+
17700
17708
  namespace duckdb {
17701
17709
  class Appender;
17702
17710
  class Catalog;
@@ -18087,6 +18095,7 @@ protected:
18087
18095
 
18088
18096
 
18089
18097
 
18098
+
18090
18099
  namespace duckdb {
18091
18100
 
18092
18101
  class ChunkCollection;
@@ -18701,6 +18710,7 @@ public:
18701
18710
 
18702
18711
  } // namespace duckdb
18703
18712
 
18713
+
18704
18714
  namespace duckdb {
18705
18715
  class StorageManager;
18706
18716
  class Catalog;
@@ -18843,6 +18853,7 @@ ExternC const PfnDliHook __pfnDliFailureHook2 = duckdb_dllimport_delay_hook;
18843
18853
  }
18844
18854
  #endif
18845
18855
  #endif
18856
+
18846
18857
  //===----------------------------------------------------------------------===//
18847
18858
  // DuckDB
18848
18859
  //