duckdb 0.3.2-dev735.0 → 0.3.2-dev739.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.2-dev735.0",
4
+ "version": "0.3.2-dev739.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -63950,10 +63950,7 @@ namespace duckdb {
63950
63950
  //! LogicalLimit represents a LIMIT clause
63951
63951
  class LogicalLimit : public LogicalOperator {
63952
63952
  public:
63953
- LogicalLimit(int64_t limit_val, int64_t offset_val, unique_ptr<Expression> limit, unique_ptr<Expression> offset)
63954
- : LogicalOperator(LogicalOperatorType::LOGICAL_LIMIT), limit_val(limit_val), offset_val(offset_val),
63955
- limit(move(limit)), offset(move(offset)) {
63956
- }
63953
+ LogicalLimit(int64_t limit_val, int64_t offset_val, unique_ptr<Expression> limit, unique_ptr<Expression> offset);
63957
63954
 
63958
63955
  //! Limit and offset values in case they are constants, used in optimizations.
63959
63956
  int64_t limit_val;
@@ -63964,14 +63961,12 @@ public:
63964
63961
  unique_ptr<Expression> offset;
63965
63962
 
63966
63963
  public:
63967
- vector<ColumnBinding> GetColumnBindings() override {
63968
- return children[0]->GetColumnBindings();
63969
- }
63964
+ vector<ColumnBinding> GetColumnBindings() override;
63965
+
63966
+ idx_t EstimateCardinality(ClientContext &context) override;
63970
63967
 
63971
63968
  protected:
63972
- void ResolveTypes() override {
63973
- types = children[0]->types;
63974
- }
63969
+ void ResolveTypes() override;
63975
63970
  };
63976
63971
  } // namespace duckdb
63977
63972
 
@@ -64394,23 +64389,18 @@ namespace duckdb {
64394
64389
  //! LogicalSample represents a SAMPLE clause
64395
64390
  class LogicalSample : public LogicalOperator {
64396
64391
  public:
64397
- LogicalSample(unique_ptr<SampleOptions> sample_options_p, unique_ptr<LogicalOperator> child)
64398
- : LogicalOperator(LogicalOperatorType::LOGICAL_SAMPLE), sample_options(move(sample_options_p)) {
64399
- children.push_back(move(child));
64400
- }
64392
+ LogicalSample(unique_ptr<SampleOptions> sample_options_p, unique_ptr<LogicalOperator> child);
64401
64393
 
64402
64394
  //! The sample options
64403
64395
  unique_ptr<SampleOptions> sample_options;
64404
64396
 
64405
64397
  public:
64406
- vector<ColumnBinding> GetColumnBindings() override {
64407
- return children[0]->GetColumnBindings();
64408
- }
64398
+ vector<ColumnBinding> GetColumnBindings() override;
64399
+
64400
+ idx_t EstimateCardinality(ClientContext &context) override;
64409
64401
 
64410
64402
  protected:
64411
- void ResolveTypes() override {
64412
- types = children[0]->types;
64413
- }
64403
+ void ResolveTypes() override;
64414
64404
  };
64415
64405
 
64416
64406
  } // namespace duckdb
@@ -150796,6 +150786,33 @@ void LogicalJoin::GetExpressionBindings(Expression &expr, unordered_set<idx_t> &
150796
150786
  } // namespace duckdb
150797
150787
 
150798
150788
 
150789
+ namespace duckdb {
150790
+
150791
+ LogicalLimit::LogicalLimit(int64_t limit_val, int64_t offset_val, unique_ptr<Expression> limit,
150792
+ unique_ptr<Expression> offset)
150793
+ : LogicalOperator(LogicalOperatorType::LOGICAL_LIMIT), limit_val(limit_val), offset_val(offset_val),
150794
+ limit(move(limit)), offset(move(offset)) {
150795
+ }
150796
+
150797
+ vector<ColumnBinding> LogicalLimit::GetColumnBindings() {
150798
+ return children[0]->GetColumnBindings();
150799
+ }
150800
+
150801
+ idx_t LogicalLimit::EstimateCardinality(ClientContext &context) {
150802
+ auto child_cardinality = children[0]->EstimateCardinality(context);
150803
+ if (limit_val >= 0 && idx_t(limit_val) < child_cardinality) {
150804
+ child_cardinality = limit_val;
150805
+ }
150806
+ return child_cardinality;
150807
+ }
150808
+
150809
+ void LogicalLimit::ResolveTypes() {
150810
+ types = children[0]->types;
150811
+ }
150812
+
150813
+ } // namespace duckdb
150814
+
150815
+
150799
150816
  namespace duckdb {
150800
150817
 
150801
150818
  LogicalProjection::LogicalProjection(idx_t table_index, vector<unique_ptr<Expression>> select_list)
@@ -150815,6 +150832,37 @@ void LogicalProjection::ResolveTypes() {
150815
150832
  } // namespace duckdb
150816
150833
 
150817
150834
 
150835
+ namespace duckdb {
150836
+
150837
+ LogicalSample::LogicalSample(unique_ptr<SampleOptions> sample_options_p, unique_ptr<LogicalOperator> child)
150838
+ : LogicalOperator(LogicalOperatorType::LOGICAL_SAMPLE), sample_options(move(sample_options_p)) {
150839
+ children.push_back(move(child));
150840
+ }
150841
+
150842
+ vector<ColumnBinding> LogicalSample::GetColumnBindings() {
150843
+ return children[0]->GetColumnBindings();
150844
+ }
150845
+
150846
+ idx_t LogicalSample::EstimateCardinality(ClientContext &context) {
150847
+ auto child_cardinality = children[0]->EstimateCardinality(context);
150848
+ if (sample_options->is_percentage) {
150849
+ return idx_t(child_cardinality * sample_options->sample_size.GetValue<double>());
150850
+ } else {
150851
+ auto sample_size = sample_options->sample_size.GetValue<uint64_t>();
150852
+ if (sample_size < child_cardinality) {
150853
+ return sample_size;
150854
+ }
150855
+ }
150856
+ return child_cardinality;
150857
+ }
150858
+
150859
+ void LogicalSample::ResolveTypes() {
150860
+ types = children[0]->types;
150861
+ }
150862
+
150863
+ } // namespace duckdb
150864
+
150865
+
150818
150866
  namespace duckdb {
150819
150867
 
150820
150868
  vector<ColumnBinding> LogicalUnnest::GetColumnBindings() {
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 "19f1a4d63"
15
- #define DUCKDB_VERSION "0.3.2-dev735"
14
+ #define DUCKDB_SOURCE_ID "2bb221361"
15
+ #define DUCKDB_VERSION "0.3.2-dev739"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //