duckdb 0.3.5-dev544.0 → 0.3.5-dev546.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 +1 -1
- package/src/duckdb.hpp +483 -483
- package/src/parquet-amalgamation.cpp +25723 -25723
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 "
|
|
15
|
-
#define DUCKDB_VERSION "v0.3.5-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "b6ce7858a"
|
|
15
|
+
#define DUCKDB_VERSION "v0.3.5-dev546"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -22673,7 +22673,7 @@ public:
|
|
|
22673
22673
|
//===----------------------------------------------------------------------===//
|
|
22674
22674
|
// DuckDB
|
|
22675
22675
|
//
|
|
22676
|
-
// duckdb/parser/expression/
|
|
22676
|
+
// duckdb/parser/expression/parameter_expression.hpp
|
|
22677
22677
|
//
|
|
22678
22678
|
//
|
|
22679
22679
|
//===----------------------------------------------------------------------===//
|
|
@@ -22682,25 +22682,54 @@ public:
|
|
|
22682
22682
|
|
|
22683
22683
|
|
|
22684
22684
|
|
|
22685
|
-
|
|
22686
22685
|
namespace duckdb {
|
|
22687
|
-
|
|
22688
|
-
//! Represents a * expression in the SELECT clause
|
|
22689
|
-
class StarExpression : public ParsedExpression {
|
|
22686
|
+
class ParameterExpression : public ParsedExpression {
|
|
22690
22687
|
public:
|
|
22691
|
-
|
|
22688
|
+
ParameterExpression();
|
|
22692
22689
|
|
|
22693
|
-
|
|
22694
|
-
string relation_name;
|
|
22695
|
-
//! List of columns to exclude from the STAR expression
|
|
22696
|
-
case_insensitive_set_t exclude_list;
|
|
22697
|
-
//! List of columns to replace with another expression
|
|
22698
|
-
case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
|
|
22690
|
+
idx_t parameter_nr;
|
|
22699
22691
|
|
|
22700
22692
|
public:
|
|
22693
|
+
bool IsScalar() const override {
|
|
22694
|
+
return true;
|
|
22695
|
+
}
|
|
22696
|
+
bool HasParameter() const override {
|
|
22697
|
+
return true;
|
|
22698
|
+
}
|
|
22699
|
+
|
|
22701
22700
|
string ToString() const override;
|
|
22702
22701
|
|
|
22703
|
-
|
|
22702
|
+
unique_ptr<ParsedExpression> Copy() const override;
|
|
22703
|
+
hash_t Hash() const override;
|
|
22704
|
+
|
|
22705
|
+
void Serialize(FieldWriter &writer) const override;
|
|
22706
|
+
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
22707
|
+
};
|
|
22708
|
+
} // namespace duckdb
|
|
22709
|
+
//===----------------------------------------------------------------------===//
|
|
22710
|
+
// DuckDB
|
|
22711
|
+
//
|
|
22712
|
+
// duckdb/parser/expression/default_expression.hpp
|
|
22713
|
+
//
|
|
22714
|
+
//
|
|
22715
|
+
//===----------------------------------------------------------------------===//
|
|
22716
|
+
|
|
22717
|
+
|
|
22718
|
+
|
|
22719
|
+
|
|
22720
|
+
|
|
22721
|
+
namespace duckdb {
|
|
22722
|
+
//! Represents the default value of a column
|
|
22723
|
+
class DefaultExpression : public ParsedExpression {
|
|
22724
|
+
public:
|
|
22725
|
+
DefaultExpression();
|
|
22726
|
+
|
|
22727
|
+
public:
|
|
22728
|
+
bool IsScalar() const override {
|
|
22729
|
+
return false;
|
|
22730
|
+
}
|
|
22731
|
+
|
|
22732
|
+
string ToString() const override;
|
|
22704
22733
|
|
|
22705
22734
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
22706
22735
|
|
|
@@ -22756,7 +22785,7 @@ public:
|
|
|
22756
22785
|
//===----------------------------------------------------------------------===//
|
|
22757
22786
|
// DuckDB
|
|
22758
22787
|
//
|
|
22759
|
-
// duckdb/parser/expression/
|
|
22788
|
+
// duckdb/parser/expression/between_expression.hpp
|
|
22760
22789
|
//
|
|
22761
22790
|
//
|
|
22762
22791
|
//===----------------------------------------------------------------------===//
|
|
@@ -22766,31 +22795,39 @@ public:
|
|
|
22766
22795
|
|
|
22767
22796
|
|
|
22768
22797
|
namespace duckdb {
|
|
22769
|
-
|
|
22798
|
+
|
|
22799
|
+
class BetweenExpression : public ParsedExpression {
|
|
22770
22800
|
public:
|
|
22771
|
-
DUCKDB_API
|
|
22801
|
+
DUCKDB_API BetweenExpression(unique_ptr<ParsedExpression> input, unique_ptr<ParsedExpression> lower,
|
|
22802
|
+
unique_ptr<ParsedExpression> upper);
|
|
22772
22803
|
|
|
22773
|
-
|
|
22804
|
+
unique_ptr<ParsedExpression> input;
|
|
22805
|
+
unique_ptr<ParsedExpression> lower;
|
|
22806
|
+
unique_ptr<ParsedExpression> upper;
|
|
22774
22807
|
|
|
22775
22808
|
public:
|
|
22776
|
-
bool IsScalar() const override {
|
|
22777
|
-
return false;
|
|
22778
|
-
}
|
|
22779
|
-
|
|
22780
22809
|
string ToString() const override;
|
|
22781
22810
|
|
|
22782
|
-
static bool Equals(const
|
|
22811
|
+
static bool Equals(const BetweenExpression *a, const BetweenExpression *b);
|
|
22812
|
+
|
|
22783
22813
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
22784
|
-
hash_t Hash() const override;
|
|
22785
22814
|
|
|
22786
22815
|
void Serialize(FieldWriter &writer) const override;
|
|
22787
22816
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
22817
|
+
|
|
22818
|
+
public:
|
|
22819
|
+
template <class T, class BASE>
|
|
22820
|
+
static string ToString(const T &entry) {
|
|
22821
|
+
return entry.input->ToString() + " BETWEEN " + entry.lower->ToString() + " AND " + entry.upper->ToString();
|
|
22822
|
+
}
|
|
22788
22823
|
};
|
|
22789
22824
|
} // namespace duckdb
|
|
22825
|
+
|
|
22826
|
+
|
|
22790
22827
|
//===----------------------------------------------------------------------===//
|
|
22791
22828
|
// DuckDB
|
|
22792
22829
|
//
|
|
22793
|
-
// duckdb/parser/expression/
|
|
22830
|
+
// duckdb/parser/expression/case_expression.hpp
|
|
22794
22831
|
//
|
|
22795
22832
|
//
|
|
22796
22833
|
//===----------------------------------------------------------------------===//
|
|
@@ -22802,22 +22839,23 @@ public:
|
|
|
22802
22839
|
|
|
22803
22840
|
namespace duckdb {
|
|
22804
22841
|
|
|
22805
|
-
|
|
22806
|
-
|
|
22842
|
+
struct CaseCheck {
|
|
22843
|
+
unique_ptr<ParsedExpression> when_expr;
|
|
22844
|
+
unique_ptr<ParsedExpression> then_expr;
|
|
22845
|
+
};
|
|
22846
|
+
|
|
22847
|
+
//! The CaseExpression represents a CASE expression in the query
|
|
22848
|
+
class CaseExpression : public ParsedExpression {
|
|
22807
22849
|
public:
|
|
22808
|
-
DUCKDB_API
|
|
22809
|
-
DUCKDB_API ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
|
|
22810
|
-
DUCKDB_API ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left,
|
|
22811
|
-
unique_ptr<ParsedExpression> right);
|
|
22850
|
+
DUCKDB_API CaseExpression();
|
|
22812
22851
|
|
|
22813
|
-
vector<
|
|
22852
|
+
vector<CaseCheck> case_checks;
|
|
22853
|
+
unique_ptr<ParsedExpression> else_expr;
|
|
22814
22854
|
|
|
22815
22855
|
public:
|
|
22816
|
-
void AddExpression(unique_ptr<ParsedExpression> expr);
|
|
22817
|
-
|
|
22818
22856
|
string ToString() const override;
|
|
22819
22857
|
|
|
22820
|
-
static bool Equals(const
|
|
22858
|
+
static bool Equals(const CaseExpression *a, const CaseExpression *b);
|
|
22821
22859
|
|
|
22822
22860
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
22823
22861
|
|
|
@@ -22827,50 +22865,19 @@ public:
|
|
|
22827
22865
|
public:
|
|
22828
22866
|
template <class T, class BASE>
|
|
22829
22867
|
static string ToString(const T &entry) {
|
|
22830
|
-
string
|
|
22831
|
-
for (
|
|
22832
|
-
|
|
22868
|
+
string case_str = "CASE ";
|
|
22869
|
+
for (auto &check : entry.case_checks) {
|
|
22870
|
+
case_str += " WHEN (" + check.when_expr->ToString() + ")";
|
|
22871
|
+
case_str += " THEN (" + check.then_expr->ToString() + ")";
|
|
22833
22872
|
}
|
|
22834
|
-
|
|
22873
|
+
case_str += " ELSE " + entry.else_expr->ToString();
|
|
22874
|
+
case_str += " END";
|
|
22875
|
+
return case_str;
|
|
22835
22876
|
}
|
|
22836
22877
|
};
|
|
22837
22878
|
} // namespace duckdb
|
|
22838
|
-
//===----------------------------------------------------------------------===//
|
|
22839
|
-
// DuckDB
|
|
22840
|
-
//
|
|
22841
|
-
// duckdb/parser/expression/parameter_expression.hpp
|
|
22842
|
-
//
|
|
22843
|
-
//
|
|
22844
|
-
//===----------------------------------------------------------------------===//
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
|
|
22849
22879
|
|
|
22850
|
-
namespace duckdb {
|
|
22851
|
-
class ParameterExpression : public ParsedExpression {
|
|
22852
|
-
public:
|
|
22853
|
-
ParameterExpression();
|
|
22854
|
-
|
|
22855
|
-
idx_t parameter_nr;
|
|
22856
|
-
|
|
22857
|
-
public:
|
|
22858
|
-
bool IsScalar() const override {
|
|
22859
|
-
return true;
|
|
22860
|
-
}
|
|
22861
|
-
bool HasParameter() const override {
|
|
22862
|
-
return true;
|
|
22863
|
-
}
|
|
22864
|
-
|
|
22865
|
-
string ToString() const override;
|
|
22866
22880
|
|
|
22867
|
-
unique_ptr<ParsedExpression> Copy() const override;
|
|
22868
|
-
hash_t Hash() const override;
|
|
22869
|
-
|
|
22870
|
-
void Serialize(FieldWriter &writer) const override;
|
|
22871
|
-
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
22872
|
-
};
|
|
22873
|
-
} // namespace duckdb
|
|
22874
22881
|
//===----------------------------------------------------------------------===//
|
|
22875
22882
|
// DuckDB
|
|
22876
22883
|
//
|
|
@@ -22906,59 +22913,12 @@ public:
|
|
|
22906
22913
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
22907
22914
|
};
|
|
22908
22915
|
} // namespace duckdb
|
|
22909
|
-
//===----------------------------------------------------------------------===//
|
|
22910
|
-
// DuckDB
|
|
22911
|
-
//
|
|
22912
|
-
// duckdb/parser/expression/subquery_expression.hpp
|
|
22913
|
-
//
|
|
22914
|
-
//
|
|
22915
|
-
//===----------------------------------------------------------------------===//
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
namespace duckdb {
|
|
22924
|
-
|
|
22925
|
-
//! Represents a subquery
|
|
22926
|
-
class SubqueryExpression : public ParsedExpression {
|
|
22927
|
-
public:
|
|
22928
|
-
SubqueryExpression();
|
|
22929
|
-
|
|
22930
|
-
//! The actual subquery
|
|
22931
|
-
unique_ptr<SelectStatement> subquery;
|
|
22932
|
-
//! The subquery type
|
|
22933
|
-
SubqueryType subquery_type;
|
|
22934
|
-
//! the child expression to compare with (in case of IN, ANY, ALL operators, empty for EXISTS queries and scalar
|
|
22935
|
-
//! subquery)
|
|
22936
|
-
unique_ptr<ParsedExpression> child;
|
|
22937
|
-
//! The comparison type of the child expression with the subquery (in case of ANY, ALL operators), empty otherwise
|
|
22938
|
-
ExpressionType comparison_type;
|
|
22939
|
-
|
|
22940
|
-
public:
|
|
22941
|
-
bool HasSubquery() const override {
|
|
22942
|
-
return true;
|
|
22943
|
-
}
|
|
22944
|
-
bool IsScalar() const override {
|
|
22945
|
-
return false;
|
|
22946
|
-
}
|
|
22947
|
-
|
|
22948
|
-
string ToString() const override;
|
|
22949
|
-
|
|
22950
|
-
static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
|
|
22951
22916
|
|
|
22952
|
-
unique_ptr<ParsedExpression> Copy() const override;
|
|
22953
22917
|
|
|
22954
|
-
void Serialize(FieldWriter &writer) const override;
|
|
22955
|
-
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
22956
|
-
};
|
|
22957
|
-
} // namespace duckdb
|
|
22958
22918
|
//===----------------------------------------------------------------------===//
|
|
22959
22919
|
// DuckDB
|
|
22960
22920
|
//
|
|
22961
|
-
// duckdb/parser/expression/
|
|
22921
|
+
// duckdb/parser/expression/comparison_expression.hpp
|
|
22962
22922
|
//
|
|
22963
22923
|
//
|
|
22964
22924
|
//===----------------------------------------------------------------------===//
|
|
@@ -22968,20 +22928,20 @@ public:
|
|
|
22968
22928
|
|
|
22969
22929
|
|
|
22970
22930
|
namespace duckdb {
|
|
22971
|
-
|
|
22972
|
-
|
|
22931
|
+
//! ComparisonExpression represents a boolean comparison (e.g. =, >=, <>). Always returns a boolean
|
|
22932
|
+
//! and has two children.
|
|
22933
|
+
class ComparisonExpression : public ParsedExpression {
|
|
22973
22934
|
public:
|
|
22974
|
-
DUCKDB_API
|
|
22975
|
-
|
|
22935
|
+
DUCKDB_API ComparisonExpression(ExpressionType type, unique_ptr<ParsedExpression> left,
|
|
22936
|
+
unique_ptr<ParsedExpression> right);
|
|
22976
22937
|
|
|
22977
|
-
unique_ptr<ParsedExpression>
|
|
22978
|
-
unique_ptr<ParsedExpression>
|
|
22979
|
-
unique_ptr<ParsedExpression> upper;
|
|
22938
|
+
unique_ptr<ParsedExpression> left;
|
|
22939
|
+
unique_ptr<ParsedExpression> right;
|
|
22980
22940
|
|
|
22981
22941
|
public:
|
|
22982
22942
|
string ToString() const override;
|
|
22983
22943
|
|
|
22984
|
-
static bool Equals(const
|
|
22944
|
+
static bool Equals(const ComparisonExpression *a, const ComparisonExpression *b);
|
|
22985
22945
|
|
|
22986
22946
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
22987
22947
|
|
|
@@ -22991,14 +22951,15 @@ public:
|
|
|
22991
22951
|
public:
|
|
22992
22952
|
template <class T, class BASE>
|
|
22993
22953
|
static string ToString(const T &entry) {
|
|
22994
|
-
return entry.
|
|
22954
|
+
return entry.left->ToString() + " " + ExpressionTypeToOperator(entry.type) + " " + entry.right->ToString();
|
|
22995
22955
|
}
|
|
22996
22956
|
};
|
|
22997
22957
|
} // namespace duckdb
|
|
22958
|
+
|
|
22998
22959
|
//===----------------------------------------------------------------------===//
|
|
22999
22960
|
// DuckDB
|
|
23000
22961
|
//
|
|
23001
|
-
// duckdb/parser/expression/
|
|
22962
|
+
// duckdb/parser/expression/conjunction_expression.hpp
|
|
23002
22963
|
//
|
|
23003
22964
|
//
|
|
23004
22965
|
//===----------------------------------------------------------------------===//
|
|
@@ -23010,23 +22971,22 @@ public:
|
|
|
23010
22971
|
|
|
23011
22972
|
namespace duckdb {
|
|
23012
22973
|
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
unique_ptr<ParsedExpression> then_expr;
|
|
23016
|
-
};
|
|
23017
|
-
|
|
23018
|
-
//! The CaseExpression represents a CASE expression in the query
|
|
23019
|
-
class CaseExpression : public ParsedExpression {
|
|
22974
|
+
//! Represents a conjunction (AND/OR)
|
|
22975
|
+
class ConjunctionExpression : public ParsedExpression {
|
|
23020
22976
|
public:
|
|
23021
|
-
DUCKDB_API
|
|
22977
|
+
DUCKDB_API explicit ConjunctionExpression(ExpressionType type);
|
|
22978
|
+
DUCKDB_API ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
|
|
22979
|
+
DUCKDB_API ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left,
|
|
22980
|
+
unique_ptr<ParsedExpression> right);
|
|
23022
22981
|
|
|
23023
|
-
vector<
|
|
23024
|
-
unique_ptr<ParsedExpression> else_expr;
|
|
22982
|
+
vector<unique_ptr<ParsedExpression>> children;
|
|
23025
22983
|
|
|
23026
22984
|
public:
|
|
22985
|
+
void AddExpression(unique_ptr<ParsedExpression> expr);
|
|
22986
|
+
|
|
23027
22987
|
string ToString() const override;
|
|
23028
22988
|
|
|
23029
|
-
static bool Equals(const
|
|
22989
|
+
static bool Equals(const ConjunctionExpression *a, const ConjunctionExpression *b);
|
|
23030
22990
|
|
|
23031
22991
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
23032
22992
|
|
|
@@ -23036,17 +22996,15 @@ public:
|
|
|
23036
22996
|
public:
|
|
23037
22997
|
template <class T, class BASE>
|
|
23038
22998
|
static string ToString(const T &entry) {
|
|
23039
|
-
string
|
|
23040
|
-
for (
|
|
23041
|
-
|
|
23042
|
-
case_str += " THEN (" + check.then_expr->ToString() + ")";
|
|
22999
|
+
string result = "(" + entry.children[0]->ToString();
|
|
23000
|
+
for (idx_t i = 1; i < entry.children.size(); i++) {
|
|
23001
|
+
result += " " + ExpressionTypeToOperator(entry.type) + " " + entry.children[i]->ToString();
|
|
23043
23002
|
}
|
|
23044
|
-
|
|
23045
|
-
case_str += " END";
|
|
23046
|
-
return case_str;
|
|
23003
|
+
return result + ")";
|
|
23047
23004
|
}
|
|
23048
23005
|
};
|
|
23049
23006
|
} // namespace duckdb
|
|
23007
|
+
|
|
23050
23008
|
//===----------------------------------------------------------------------===//
|
|
23051
23009
|
// DuckDB
|
|
23052
23010
|
//
|
|
@@ -23083,6 +23041,8 @@ public:
|
|
|
23083
23041
|
};
|
|
23084
23042
|
|
|
23085
23043
|
} // namespace duckdb
|
|
23044
|
+
|
|
23045
|
+
|
|
23086
23046
|
//===----------------------------------------------------------------------===//
|
|
23087
23047
|
// DuckDB
|
|
23088
23048
|
//
|
|
@@ -23201,15 +23161,10 @@ public:
|
|
|
23201
23161
|
};
|
|
23202
23162
|
} // namespace duckdb
|
|
23203
23163
|
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
|
|
23207
|
-
|
|
23208
|
-
|
|
23209
23164
|
//===----------------------------------------------------------------------===//
|
|
23210
23165
|
// DuckDB
|
|
23211
23166
|
//
|
|
23212
|
-
// duckdb/parser/expression/
|
|
23167
|
+
// duckdb/parser/expression/lambda_expression.hpp
|
|
23213
23168
|
//
|
|
23214
23169
|
//
|
|
23215
23170
|
//===----------------------------------------------------------------------===//
|
|
@@ -23218,33 +23173,32 @@ public:
|
|
|
23218
23173
|
|
|
23219
23174
|
|
|
23220
23175
|
|
|
23176
|
+
|
|
23221
23177
|
namespace duckdb {
|
|
23222
|
-
|
|
23223
|
-
//!
|
|
23224
|
-
|
|
23178
|
+
|
|
23179
|
+
//! LambdaExpression represents either:
|
|
23180
|
+
//! 1. A lambda operator that can be used for e.g. mapping an expression to a list
|
|
23181
|
+
//! 2. An OperatorExpression with the "->" operator
|
|
23182
|
+
//! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
|
|
23183
|
+
class LambdaExpression : public ParsedExpression {
|
|
23225
23184
|
public:
|
|
23226
|
-
|
|
23227
|
-
unique_ptr<ParsedExpression> right);
|
|
23185
|
+
LambdaExpression(unique_ptr<ParsedExpression> lhs, unique_ptr<ParsedExpression> rhs);
|
|
23228
23186
|
|
|
23229
|
-
unique_ptr<ParsedExpression>
|
|
23230
|
-
unique_ptr<ParsedExpression>
|
|
23187
|
+
unique_ptr<ParsedExpression> lhs;
|
|
23188
|
+
unique_ptr<ParsedExpression> rhs;
|
|
23231
23189
|
|
|
23232
23190
|
public:
|
|
23233
23191
|
string ToString() const override;
|
|
23234
23192
|
|
|
23235
|
-
static bool Equals(const
|
|
23193
|
+
static bool Equals(const LambdaExpression *a, const LambdaExpression *b);
|
|
23194
|
+
hash_t Hash() const override;
|
|
23236
23195
|
|
|
23237
23196
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
23238
23197
|
|
|
23239
23198
|
void Serialize(FieldWriter &writer) const override;
|
|
23240
23199
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
23241
|
-
|
|
23242
|
-
public:
|
|
23243
|
-
template <class T, class BASE>
|
|
23244
|
-
static string ToString(const T &entry) {
|
|
23245
|
-
return entry.left->ToString() + " " + ExpressionTypeToOperator(entry.type) + " " + entry.right->ToString();
|
|
23246
|
-
}
|
|
23247
23200
|
};
|
|
23201
|
+
|
|
23248
23202
|
} // namespace duckdb
|
|
23249
23203
|
|
|
23250
23204
|
|
|
@@ -23252,7 +23206,7 @@ public:
|
|
|
23252
23206
|
//===----------------------------------------------------------------------===//
|
|
23253
23207
|
// DuckDB
|
|
23254
23208
|
//
|
|
23255
|
-
// duckdb/parser/expression/
|
|
23209
|
+
// duckdb/parser/expression/positional_reference_expression.hpp
|
|
23256
23210
|
//
|
|
23257
23211
|
//
|
|
23258
23212
|
//===----------------------------------------------------------------------===//
|
|
@@ -23262,10 +23216,11 @@ public:
|
|
|
23262
23216
|
|
|
23263
23217
|
|
|
23264
23218
|
namespace duckdb {
|
|
23265
|
-
|
|
23266
|
-
class DefaultExpression : public ParsedExpression {
|
|
23219
|
+
class PositionalReferenceExpression : public ParsedExpression {
|
|
23267
23220
|
public:
|
|
23268
|
-
|
|
23221
|
+
DUCKDB_API PositionalReferenceExpression(idx_t index);
|
|
23222
|
+
|
|
23223
|
+
idx_t index;
|
|
23269
23224
|
|
|
23270
23225
|
public:
|
|
23271
23226
|
bool IsScalar() const override {
|
|
@@ -23274,18 +23229,19 @@ public:
|
|
|
23274
23229
|
|
|
23275
23230
|
string ToString() const override;
|
|
23276
23231
|
|
|
23232
|
+
static bool Equals(const PositionalReferenceExpression *a, const PositionalReferenceExpression *b);
|
|
23277
23233
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
23234
|
+
hash_t Hash() const override;
|
|
23278
23235
|
|
|
23279
23236
|
void Serialize(FieldWriter &writer) const override;
|
|
23280
23237
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
23281
23238
|
};
|
|
23282
23239
|
} // namespace duckdb
|
|
23283
23240
|
|
|
23284
|
-
|
|
23285
23241
|
//===----------------------------------------------------------------------===//
|
|
23286
23242
|
// DuckDB
|
|
23287
23243
|
//
|
|
23288
|
-
// duckdb/parser/expression/
|
|
23244
|
+
// duckdb/parser/expression/star_expression.hpp
|
|
23289
23245
|
//
|
|
23290
23246
|
//
|
|
23291
23247
|
//===----------------------------------------------------------------------===//
|
|
@@ -23297,41 +23253,85 @@ public:
|
|
|
23297
23253
|
|
|
23298
23254
|
namespace duckdb {
|
|
23299
23255
|
|
|
23300
|
-
//!
|
|
23301
|
-
|
|
23302
|
-
//! 2. An OperatorExpression with the "->" operator
|
|
23303
|
-
//! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
|
|
23304
|
-
class LambdaExpression : public ParsedExpression {
|
|
23256
|
+
//! Represents a * expression in the SELECT clause
|
|
23257
|
+
class StarExpression : public ParsedExpression {
|
|
23305
23258
|
public:
|
|
23306
|
-
|
|
23259
|
+
StarExpression(string relation_name = string());
|
|
23307
23260
|
|
|
23308
|
-
|
|
23309
|
-
|
|
23261
|
+
//! The relation name in case of tbl.*, or empty if this is a normal *
|
|
23262
|
+
string relation_name;
|
|
23263
|
+
//! List of columns to exclude from the STAR expression
|
|
23264
|
+
case_insensitive_set_t exclude_list;
|
|
23265
|
+
//! List of columns to replace with another expression
|
|
23266
|
+
case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
|
|
23310
23267
|
|
|
23311
23268
|
public:
|
|
23312
23269
|
string ToString() const override;
|
|
23313
23270
|
|
|
23314
|
-
static bool Equals(const
|
|
23315
|
-
hash_t Hash() const override;
|
|
23271
|
+
static bool Equals(const StarExpression *a, const StarExpression *b);
|
|
23316
23272
|
|
|
23317
23273
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
23318
23274
|
|
|
23319
23275
|
void Serialize(FieldWriter &writer) const override;
|
|
23320
23276
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
23321
23277
|
};
|
|
23322
|
-
|
|
23323
23278
|
} // namespace duckdb
|
|
23324
23279
|
|
|
23280
|
+
//===----------------------------------------------------------------------===//
|
|
23281
|
+
// DuckDB
|
|
23282
|
+
//
|
|
23283
|
+
// duckdb/parser/expression/subquery_expression.hpp
|
|
23284
|
+
//
|
|
23285
|
+
//
|
|
23286
|
+
//===----------------------------------------------------------------------===//
|
|
23287
|
+
|
|
23288
|
+
|
|
23289
|
+
|
|
23290
|
+
|
|
23291
|
+
|
|
23292
|
+
|
|
23293
|
+
|
|
23294
|
+
namespace duckdb {
|
|
23295
|
+
|
|
23296
|
+
//! Represents a subquery
|
|
23297
|
+
class SubqueryExpression : public ParsedExpression {
|
|
23298
|
+
public:
|
|
23299
|
+
SubqueryExpression();
|
|
23300
|
+
|
|
23301
|
+
//! The actual subquery
|
|
23302
|
+
unique_ptr<SelectStatement> subquery;
|
|
23303
|
+
//! The subquery type
|
|
23304
|
+
SubqueryType subquery_type;
|
|
23305
|
+
//! the child expression to compare with (in case of IN, ANY, ALL operators, empty for EXISTS queries and scalar
|
|
23306
|
+
//! subquery)
|
|
23307
|
+
unique_ptr<ParsedExpression> child;
|
|
23308
|
+
//! The comparison type of the child expression with the subquery (in case of ANY, ALL operators), empty otherwise
|
|
23309
|
+
ExpressionType comparison_type;
|
|
23325
23310
|
|
|
23311
|
+
public:
|
|
23312
|
+
bool HasSubquery() const override {
|
|
23313
|
+
return true;
|
|
23314
|
+
}
|
|
23315
|
+
bool IsScalar() const override {
|
|
23316
|
+
return false;
|
|
23317
|
+
}
|
|
23326
23318
|
|
|
23319
|
+
string ToString() const override;
|
|
23327
23320
|
|
|
23321
|
+
static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
|
|
23328
23322
|
|
|
23323
|
+
unique_ptr<ParsedExpression> Copy() const override;
|
|
23324
|
+
|
|
23325
|
+
void Serialize(FieldWriter &writer) const override;
|
|
23326
|
+
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
23327
|
+
};
|
|
23328
|
+
} // namespace duckdb
|
|
23329
23329
|
|
|
23330
23330
|
|
|
23331
23331
|
//===----------------------------------------------------------------------===//
|
|
23332
23332
|
// DuckDB
|
|
23333
23333
|
//
|
|
23334
|
-
// duckdb/parser/parsed_data/
|
|
23334
|
+
// duckdb/parser/parsed_data/vacuum_info.hpp
|
|
23335
23335
|
//
|
|
23336
23336
|
//
|
|
23337
23337
|
//===----------------------------------------------------------------------===//
|
|
@@ -23340,31 +23340,20 @@ public:
|
|
|
23340
23340
|
|
|
23341
23341
|
|
|
23342
23342
|
|
|
23343
|
-
|
|
23344
23343
|
namespace duckdb {
|
|
23345
23344
|
|
|
23346
|
-
|
|
23347
|
-
explicit CreateAggregateFunctionInfo(AggregateFunction function)
|
|
23348
|
-
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(function.name) {
|
|
23349
|
-
this->name = function.name;
|
|
23350
|
-
functions.AddFunction(move(function));
|
|
23351
|
-
}
|
|
23352
|
-
|
|
23353
|
-
explicit CreateAggregateFunctionInfo(AggregateFunctionSet set)
|
|
23354
|
-
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(move(set)) {
|
|
23355
|
-
this->name = functions.name;
|
|
23356
|
-
for (auto &func : functions.functions) {
|
|
23357
|
-
func.name = functions.name;
|
|
23358
|
-
}
|
|
23359
|
-
}
|
|
23345
|
+
enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
|
|
23360
23346
|
|
|
23361
|
-
|
|
23347
|
+
struct LoadInfo : public ParseInfo {
|
|
23348
|
+
std::string filename;
|
|
23349
|
+
LoadType load_type;
|
|
23362
23350
|
|
|
23363
23351
|
public:
|
|
23364
|
-
unique_ptr<
|
|
23365
|
-
auto result = make_unique<
|
|
23366
|
-
|
|
23367
|
-
|
|
23352
|
+
unique_ptr<LoadInfo> Copy() const {
|
|
23353
|
+
auto result = make_unique<LoadInfo>();
|
|
23354
|
+
result->filename = filename;
|
|
23355
|
+
result->load_type = load_type;
|
|
23356
|
+
return result;
|
|
23368
23357
|
}
|
|
23369
23358
|
};
|
|
23370
23359
|
|
|
@@ -23372,7 +23361,7 @@ public:
|
|
|
23372
23361
|
//===----------------------------------------------------------------------===//
|
|
23373
23362
|
// DuckDB
|
|
23374
23363
|
//
|
|
23375
|
-
// duckdb/parser/parsed_data/
|
|
23364
|
+
// duckdb/parser/parsed_data/vacuum_info.hpp
|
|
23376
23365
|
//
|
|
23377
23366
|
//
|
|
23378
23367
|
//===----------------------------------------------------------------------===//
|
|
@@ -23381,42 +23370,30 @@ public:
|
|
|
23381
23370
|
|
|
23382
23371
|
|
|
23383
23372
|
|
|
23384
|
-
|
|
23385
23373
|
namespace duckdb {
|
|
23386
23374
|
|
|
23387
|
-
struct
|
|
23388
|
-
|
|
23389
|
-
}
|
|
23390
|
-
|
|
23391
|
-
//! The catalog type to drop
|
|
23392
|
-
CatalogType type;
|
|
23393
|
-
//! Schema name to drop from, if any
|
|
23394
|
-
string schema;
|
|
23395
|
-
//! Element name to drop
|
|
23396
|
-
string name;
|
|
23397
|
-
//! Ignore if the entry does not exist instead of failing
|
|
23398
|
-
bool if_exists = false;
|
|
23399
|
-
//! Cascade drop (drop all dependents instead of throwing an error if there
|
|
23400
|
-
//! are any)
|
|
23401
|
-
bool cascade = false;
|
|
23402
|
-
|
|
23403
|
-
public:
|
|
23404
|
-
unique_ptr<DropInfo> Copy() const {
|
|
23405
|
-
auto result = make_unique<DropInfo>();
|
|
23406
|
-
result->type = type;
|
|
23407
|
-
result->schema = schema;
|
|
23408
|
-
result->name = name;
|
|
23409
|
-
result->if_exists = if_exists;
|
|
23410
|
-
result->cascade = cascade;
|
|
23411
|
-
return result;
|
|
23412
|
-
}
|
|
23375
|
+
struct VacuumInfo : public ParseInfo {
|
|
23376
|
+
// nothing for now
|
|
23413
23377
|
};
|
|
23414
23378
|
|
|
23415
23379
|
} // namespace duckdb
|
|
23416
23380
|
//===----------------------------------------------------------------------===//
|
|
23417
23381
|
// DuckDB
|
|
23418
23382
|
//
|
|
23419
|
-
// duckdb/parser/parsed_data/
|
|
23383
|
+
// duckdb/parser/parsed_data/create_index_info.hpp
|
|
23384
|
+
//
|
|
23385
|
+
//
|
|
23386
|
+
//===----------------------------------------------------------------------===//
|
|
23387
|
+
|
|
23388
|
+
|
|
23389
|
+
|
|
23390
|
+
|
|
23391
|
+
|
|
23392
|
+
|
|
23393
|
+
//===----------------------------------------------------------------------===//
|
|
23394
|
+
// DuckDB
|
|
23395
|
+
//
|
|
23396
|
+
// duckdb/parser/tableref/basetableref.hpp
|
|
23420
23397
|
//
|
|
23421
23398
|
//
|
|
23422
23399
|
//===----------------------------------------------------------------------===//
|
|
@@ -23427,29 +23404,62 @@ public:
|
|
|
23427
23404
|
|
|
23428
23405
|
|
|
23429
23406
|
namespace duckdb {
|
|
23407
|
+
//! Represents a TableReference to a base table in the schema
|
|
23408
|
+
class BaseTableRef : public TableRef {
|
|
23409
|
+
public:
|
|
23410
|
+
BaseTableRef() : TableRef(TableReferenceType::BASE_TABLE), schema_name(INVALID_SCHEMA) {
|
|
23411
|
+
}
|
|
23430
23412
|
|
|
23431
|
-
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23413
|
+
//! Schema name
|
|
23414
|
+
string schema_name;
|
|
23415
|
+
//! Table name
|
|
23416
|
+
string table_name;
|
|
23417
|
+
//! Aliases for the column names
|
|
23418
|
+
vector<string> column_name_alias;
|
|
23419
|
+
|
|
23420
|
+
public:
|
|
23421
|
+
string ToString() const override;
|
|
23422
|
+
bool Equals(const TableRef *other_p) const override;
|
|
23423
|
+
|
|
23424
|
+
unique_ptr<TableRef> Copy() override;
|
|
23425
|
+
|
|
23426
|
+
//! Serializes a blob into a BaseTableRef
|
|
23427
|
+
void Serialize(FieldWriter &serializer) const override;
|
|
23428
|
+
//! Deserializes a blob back into a BaseTableRef
|
|
23429
|
+
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
23430
|
+
};
|
|
23431
|
+
} // namespace duckdb
|
|
23432
|
+
|
|
23433
|
+
|
|
23434
|
+
|
|
23435
|
+
namespace duckdb {
|
|
23436
|
+
|
|
23437
|
+
struct CreateIndexInfo : public CreateInfo {
|
|
23438
|
+
CreateIndexInfo() : CreateInfo(CatalogType::INDEX_ENTRY) {
|
|
23436
23439
|
}
|
|
23437
23440
|
|
|
23438
|
-
//!
|
|
23439
|
-
|
|
23440
|
-
//!
|
|
23441
|
-
|
|
23442
|
-
//!
|
|
23443
|
-
bool
|
|
23444
|
-
//!
|
|
23445
|
-
|
|
23446
|
-
//!
|
|
23447
|
-
|
|
23441
|
+
//! Index Type (e.g., B+-tree, Skip-List, ...)
|
|
23442
|
+
IndexType index_type;
|
|
23443
|
+
//! Name of the Index
|
|
23444
|
+
string index_name;
|
|
23445
|
+
//! If it is an unique index
|
|
23446
|
+
bool unique = false;
|
|
23447
|
+
//! The table to create the index on
|
|
23448
|
+
unique_ptr<BaseTableRef> table;
|
|
23449
|
+
//! Set of expressions to index by
|
|
23450
|
+
vector<unique_ptr<ParsedExpression>> expressions;
|
|
23448
23451
|
|
|
23449
23452
|
public:
|
|
23450
23453
|
unique_ptr<CreateInfo> Copy() const override {
|
|
23451
|
-
auto result = make_unique<
|
|
23454
|
+
auto result = make_unique<CreateIndexInfo>();
|
|
23452
23455
|
CopyProperties(*result);
|
|
23456
|
+
result->index_type = index_type;
|
|
23457
|
+
result->index_name = index_name;
|
|
23458
|
+
result->unique = unique;
|
|
23459
|
+
result->table = unique_ptr_cast<TableRef, BaseTableRef>(table->Copy());
|
|
23460
|
+
for (auto &expr : expressions) {
|
|
23461
|
+
result->expressions.push_back(expr->Copy());
|
|
23462
|
+
}
|
|
23453
23463
|
return move(result);
|
|
23454
23464
|
}
|
|
23455
23465
|
};
|
|
@@ -23519,7 +23529,7 @@ struct TransactionInfo : public ParseInfo {
|
|
|
23519
23529
|
//===----------------------------------------------------------------------===//
|
|
23520
23530
|
// DuckDB
|
|
23521
23531
|
//
|
|
23522
|
-
// duckdb/parser/parsed_data/
|
|
23532
|
+
// duckdb/parser/parsed_data/create_schema_info.hpp
|
|
23523
23533
|
//
|
|
23524
23534
|
//
|
|
23525
23535
|
//===----------------------------------------------------------------------===//
|
|
@@ -23530,18 +23540,15 @@ struct TransactionInfo : public ParseInfo {
|
|
|
23530
23540
|
|
|
23531
23541
|
namespace duckdb {
|
|
23532
23542
|
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
std::string filename;
|
|
23537
|
-
LoadType load_type;
|
|
23543
|
+
struct CreateSchemaInfo : public CreateInfo {
|
|
23544
|
+
CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) {
|
|
23545
|
+
}
|
|
23538
23546
|
|
|
23539
23547
|
public:
|
|
23540
|
-
unique_ptr<
|
|
23541
|
-
auto result = make_unique<
|
|
23542
|
-
result
|
|
23543
|
-
result
|
|
23544
|
-
return result;
|
|
23548
|
+
unique_ptr<CreateInfo> Copy() const override {
|
|
23549
|
+
auto result = make_unique<CreateSchemaInfo>();
|
|
23550
|
+
CopyProperties(*result);
|
|
23551
|
+
return move(result);
|
|
23545
23552
|
}
|
|
23546
23553
|
};
|
|
23547
23554
|
|
|
@@ -23549,7 +23556,7 @@ public:
|
|
|
23549
23556
|
//===----------------------------------------------------------------------===//
|
|
23550
23557
|
// DuckDB
|
|
23551
23558
|
//
|
|
23552
|
-
// duckdb/parser/parsed_data/
|
|
23559
|
+
// duckdb/parser/parsed_data/export_table_data.hpp
|
|
23553
23560
|
//
|
|
23554
23561
|
//
|
|
23555
23562
|
//===----------------------------------------------------------------------===//
|
|
@@ -23559,35 +23566,33 @@ public:
|
|
|
23559
23566
|
|
|
23560
23567
|
|
|
23561
23568
|
|
|
23562
|
-
|
|
23563
|
-
|
|
23564
23569
|
namespace duckdb {
|
|
23565
23570
|
|
|
23566
|
-
struct
|
|
23571
|
+
struct ExportedTableData {
|
|
23572
|
+
//! Name of the exported table
|
|
23573
|
+
string table_name;
|
|
23567
23574
|
|
|
23568
|
-
|
|
23569
|
-
|
|
23575
|
+
//! Name of the schema
|
|
23576
|
+
string schema_name;
|
|
23570
23577
|
|
|
23571
|
-
//!
|
|
23572
|
-
string
|
|
23573
|
-
|
|
23574
|
-
LogicalType type;
|
|
23578
|
+
//! Path to be exported
|
|
23579
|
+
string file_path;
|
|
23580
|
+
};
|
|
23575
23581
|
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
|
-
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
|
|
23582
|
-
|
|
23583
|
-
}
|
|
23582
|
+
struct ExportedTableInfo {
|
|
23583
|
+
TableCatalogEntry *entry;
|
|
23584
|
+
ExportedTableData table_data;
|
|
23585
|
+
};
|
|
23586
|
+
|
|
23587
|
+
struct BoundExportData : public ParseInfo {
|
|
23588
|
+
std::vector<ExportedTableInfo> data;
|
|
23584
23589
|
};
|
|
23585
23590
|
|
|
23586
23591
|
} // namespace duckdb
|
|
23587
23592
|
//===----------------------------------------------------------------------===//
|
|
23588
23593
|
// DuckDB
|
|
23589
23594
|
//
|
|
23590
|
-
// duckdb/parser/parsed_data/
|
|
23595
|
+
// duckdb/parser/parsed_data/drop_info.hpp
|
|
23591
23596
|
//
|
|
23592
23597
|
//
|
|
23593
23598
|
//===----------------------------------------------------------------------===//
|
|
@@ -23596,17 +23601,34 @@ public:
|
|
|
23596
23601
|
|
|
23597
23602
|
|
|
23598
23603
|
|
|
23604
|
+
|
|
23599
23605
|
namespace duckdb {
|
|
23600
23606
|
|
|
23601
|
-
struct
|
|
23602
|
-
|
|
23607
|
+
struct DropInfo : public ParseInfo {
|
|
23608
|
+
DropInfo() : schema(INVALID_SCHEMA), if_exists(false), cascade(false) {
|
|
23603
23609
|
}
|
|
23604
23610
|
|
|
23611
|
+
//! The catalog type to drop
|
|
23612
|
+
CatalogType type;
|
|
23613
|
+
//! Schema name to drop from, if any
|
|
23614
|
+
string schema;
|
|
23615
|
+
//! Element name to drop
|
|
23616
|
+
string name;
|
|
23617
|
+
//! Ignore if the entry does not exist instead of failing
|
|
23618
|
+
bool if_exists = false;
|
|
23619
|
+
//! Cascade drop (drop all dependents instead of throwing an error if there
|
|
23620
|
+
//! are any)
|
|
23621
|
+
bool cascade = false;
|
|
23622
|
+
|
|
23605
23623
|
public:
|
|
23606
|
-
unique_ptr<
|
|
23607
|
-
auto result = make_unique<
|
|
23608
|
-
|
|
23609
|
-
|
|
23624
|
+
unique_ptr<DropInfo> Copy() const {
|
|
23625
|
+
auto result = make_unique<DropInfo>();
|
|
23626
|
+
result->type = type;
|
|
23627
|
+
result->schema = schema;
|
|
23628
|
+
result->name = name;
|
|
23629
|
+
result->if_exists = if_exists;
|
|
23630
|
+
result->cascade = cascade;
|
|
23631
|
+
return result;
|
|
23610
23632
|
}
|
|
23611
23633
|
};
|
|
23612
23634
|
|
|
@@ -23614,7 +23636,7 @@ public:
|
|
|
23614
23636
|
//===----------------------------------------------------------------------===//
|
|
23615
23637
|
// DuckDB
|
|
23616
23638
|
//
|
|
23617
|
-
// duckdb/parser/parsed_data/
|
|
23639
|
+
// duckdb/parser/parsed_data/create_macro_info.hpp
|
|
23618
23640
|
//
|
|
23619
23641
|
//
|
|
23620
23642
|
//===----------------------------------------------------------------------===//
|
|
@@ -23622,78 +23644,115 @@ public:
|
|
|
23622
23644
|
|
|
23623
23645
|
|
|
23624
23646
|
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
23647
|
//===----------------------------------------------------------------------===//
|
|
23628
23648
|
// DuckDB
|
|
23629
23649
|
//
|
|
23630
|
-
// duckdb/
|
|
23650
|
+
// duckdb/function/macro_function.hpp
|
|
23631
23651
|
//
|
|
23632
23652
|
//
|
|
23633
23653
|
//===----------------------------------------------------------------------===//
|
|
23634
23654
|
|
|
23635
23655
|
|
|
23656
|
+
//! The SelectStatement of the view
|
|
23657
|
+
|
|
23658
|
+
|
|
23659
|
+
|
|
23636
23660
|
|
|
23637
23661
|
|
|
23638
23662
|
|
|
23639
23663
|
|
|
23640
23664
|
namespace duckdb {
|
|
23641
|
-
|
|
23642
|
-
class
|
|
23665
|
+
|
|
23666
|
+
enum class MacroType : uint8_t { VOID_MACRO = 0, TABLE_MACRO = 1, SCALAR_MACRO = 2 };
|
|
23667
|
+
|
|
23668
|
+
class MacroFunction {
|
|
23643
23669
|
public:
|
|
23644
|
-
|
|
23645
|
-
|
|
23670
|
+
// explicit MacroFunction(unique_ptr<ParsedExpression> expression);
|
|
23671
|
+
MacroFunction(MacroType type);
|
|
23646
23672
|
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
23673
|
+
// MacroFunction(void);
|
|
23674
|
+
// The type
|
|
23675
|
+
MacroType type;
|
|
23676
|
+
//! The positional parameters
|
|
23677
|
+
vector<unique_ptr<ParsedExpression>> parameters;
|
|
23678
|
+
//! The default parameters and their associated values
|
|
23679
|
+
unordered_map<string, unique_ptr<ParsedExpression>> default_parameters;
|
|
23653
23680
|
|
|
23654
23681
|
public:
|
|
23655
|
-
|
|
23656
|
-
|
|
23682
|
+
virtual ~MacroFunction() {
|
|
23683
|
+
}
|
|
23657
23684
|
|
|
23658
|
-
|
|
23685
|
+
void CopyProperties(MacroFunction &other);
|
|
23659
23686
|
|
|
23660
|
-
|
|
23661
|
-
|
|
23662
|
-
|
|
23663
|
-
|
|
23687
|
+
virtual unique_ptr<MacroFunction> Copy() = 0;
|
|
23688
|
+
|
|
23689
|
+
static string ValidateArguments(MacroFunction ¯o_function, const string &name,
|
|
23690
|
+
FunctionExpression &function_expr,
|
|
23691
|
+
vector<unique_ptr<ParsedExpression>> &positionals,
|
|
23692
|
+
unordered_map<string, unique_ptr<ParsedExpression>> &defaults);
|
|
23693
|
+
};
|
|
23694
|
+
|
|
23695
|
+
} // namespace duckdb
|
|
23696
|
+
|
|
23697
|
+
|
|
23698
|
+
namespace duckdb {
|
|
23699
|
+
|
|
23700
|
+
struct CreateMacroInfo : public CreateFunctionInfo {
|
|
23701
|
+
CreateMacroInfo() : CreateFunctionInfo(CatalogType::MACRO_ENTRY, INVALID_SCHEMA) {
|
|
23702
|
+
}
|
|
23703
|
+
|
|
23704
|
+
CreateMacroInfo(CatalogType type) : CreateFunctionInfo(type, INVALID_SCHEMA) {
|
|
23705
|
+
}
|
|
23706
|
+
|
|
23707
|
+
unique_ptr<MacroFunction> function;
|
|
23708
|
+
|
|
23709
|
+
public:
|
|
23710
|
+
unique_ptr<CreateInfo> Copy() const override {
|
|
23711
|
+
auto result = make_unique<CreateMacroInfo>();
|
|
23712
|
+
result->function = function->Copy();
|
|
23713
|
+
result->name = name;
|
|
23714
|
+
CopyProperties(*result);
|
|
23715
|
+
return move(result);
|
|
23716
|
+
}
|
|
23664
23717
|
};
|
|
23718
|
+
|
|
23665
23719
|
} // namespace duckdb
|
|
23720
|
+
//===----------------------------------------------------------------------===//
|
|
23721
|
+
// DuckDB
|
|
23722
|
+
//
|
|
23723
|
+
// duckdb/parser/parsed_data/create_aggregate_function_info.hpp
|
|
23724
|
+
//
|
|
23725
|
+
//
|
|
23726
|
+
//===----------------------------------------------------------------------===//
|
|
23727
|
+
|
|
23728
|
+
|
|
23729
|
+
|
|
23666
23730
|
|
|
23667
23731
|
|
|
23668
23732
|
|
|
23669
23733
|
namespace duckdb {
|
|
23670
23734
|
|
|
23671
|
-
struct
|
|
23672
|
-
|
|
23735
|
+
struct CreateAggregateFunctionInfo : public CreateFunctionInfo {
|
|
23736
|
+
explicit CreateAggregateFunctionInfo(AggregateFunction function)
|
|
23737
|
+
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(function.name) {
|
|
23738
|
+
this->name = function.name;
|
|
23739
|
+
functions.AddFunction(move(function));
|
|
23673
23740
|
}
|
|
23674
23741
|
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
vector<unique_ptr<ParsedExpression>> expressions;
|
|
23742
|
+
explicit CreateAggregateFunctionInfo(AggregateFunctionSet set)
|
|
23743
|
+
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(move(set)) {
|
|
23744
|
+
this->name = functions.name;
|
|
23745
|
+
for (auto &func : functions.functions) {
|
|
23746
|
+
func.name = functions.name;
|
|
23747
|
+
}
|
|
23748
|
+
}
|
|
23749
|
+
|
|
23750
|
+
AggregateFunctionSet functions;
|
|
23685
23751
|
|
|
23686
23752
|
public:
|
|
23687
23753
|
unique_ptr<CreateInfo> Copy() const override {
|
|
23688
|
-
auto result = make_unique<
|
|
23754
|
+
auto result = make_unique<CreateAggregateFunctionInfo>(functions);
|
|
23689
23755
|
CopyProperties(*result);
|
|
23690
|
-
result->index_type = index_type;
|
|
23691
|
-
result->index_name = index_name;
|
|
23692
|
-
result->unique = unique;
|
|
23693
|
-
result->table = unique_ptr_cast<TableRef, BaseTableRef>(table->Copy());
|
|
23694
|
-
for (auto &expr : expressions) {
|
|
23695
|
-
result->expressions.push_back(expr->Copy());
|
|
23696
|
-
}
|
|
23697
23756
|
return move(result);
|
|
23698
23757
|
}
|
|
23699
23758
|
};
|
|
@@ -23702,7 +23761,7 @@ public:
|
|
|
23702
23761
|
//===----------------------------------------------------------------------===//
|
|
23703
23762
|
// DuckDB
|
|
23704
23763
|
//
|
|
23705
|
-
// duckdb/parser/parsed_data/
|
|
23764
|
+
// duckdb/parser/parsed_data/create_collation_info.hpp
|
|
23706
23765
|
//
|
|
23707
23766
|
//
|
|
23708
23767
|
//===----------------------------------------------------------------------===//
|
|
@@ -23714,106 +23773,66 @@ public:
|
|
|
23714
23773
|
|
|
23715
23774
|
namespace duckdb {
|
|
23716
23775
|
|
|
23717
|
-
struct
|
|
23718
|
-
|
|
23719
|
-
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
|
|
23724
|
-
//! Path to be exported
|
|
23725
|
-
string file_path;
|
|
23726
|
-
};
|
|
23776
|
+
struct CreateCollationInfo : public CreateInfo {
|
|
23777
|
+
CreateCollationInfo(string name_p, ScalarFunction function_p, bool combinable_p, bool not_required_for_equality_p)
|
|
23778
|
+
: CreateInfo(CatalogType::COLLATION_ENTRY), function(move(function_p)), combinable(combinable_p),
|
|
23779
|
+
not_required_for_equality(not_required_for_equality_p) {
|
|
23780
|
+
this->name = move(name_p);
|
|
23781
|
+
}
|
|
23727
23782
|
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23731
|
-
|
|
23783
|
+
//! The name of the collation
|
|
23784
|
+
string name;
|
|
23785
|
+
//! The collation function to push in case collation is required
|
|
23786
|
+
ScalarFunction function;
|
|
23787
|
+
//! Whether or not the collation can be combined with other collations.
|
|
23788
|
+
bool combinable;
|
|
23789
|
+
//! Whether or not the collation is required for equality comparisons or not. For many collations a binary
|
|
23790
|
+
//! comparison for equality comparisons is correct, allowing us to skip the collation in these cases which greatly
|
|
23791
|
+
//! speeds up processing.
|
|
23792
|
+
bool not_required_for_equality;
|
|
23732
23793
|
|
|
23733
|
-
|
|
23734
|
-
|
|
23794
|
+
public:
|
|
23795
|
+
unique_ptr<CreateInfo> Copy() const override {
|
|
23796
|
+
auto result = make_unique<CreateCollationInfo>(name, function, combinable, not_required_for_equality);
|
|
23797
|
+
CopyProperties(*result);
|
|
23798
|
+
return move(result);
|
|
23799
|
+
}
|
|
23735
23800
|
};
|
|
23736
23801
|
|
|
23737
23802
|
} // namespace duckdb
|
|
23738
23803
|
//===----------------------------------------------------------------------===//
|
|
23739
23804
|
// DuckDB
|
|
23740
23805
|
//
|
|
23741
|
-
// duckdb/parser/parsed_data/
|
|
23742
|
-
//
|
|
23743
|
-
//
|
|
23744
|
-
//===----------------------------------------------------------------------===//
|
|
23745
|
-
|
|
23746
|
-
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
//===----------------------------------------------------------------------===//
|
|
23750
|
-
// DuckDB
|
|
23751
|
-
//
|
|
23752
|
-
// duckdb/function/macro_function.hpp
|
|
23806
|
+
// duckdb/parser/parsed_data/create_type_info.hpp
|
|
23753
23807
|
//
|
|
23754
23808
|
//
|
|
23755
23809
|
//===----------------------------------------------------------------------===//
|
|
23756
23810
|
|
|
23757
23811
|
|
|
23758
|
-
//! The SelectStatement of the view
|
|
23759
|
-
|
|
23760
|
-
|
|
23761
|
-
|
|
23762
|
-
|
|
23763
|
-
|
|
23764
|
-
|
|
23765
|
-
|
|
23766
|
-
namespace duckdb {
|
|
23767
|
-
|
|
23768
|
-
enum class MacroType : uint8_t { VOID_MACRO = 0, TABLE_MACRO = 1, SCALAR_MACRO = 2 };
|
|
23769
|
-
|
|
23770
|
-
class MacroFunction {
|
|
23771
|
-
public:
|
|
23772
|
-
// explicit MacroFunction(unique_ptr<ParsedExpression> expression);
|
|
23773
|
-
MacroFunction(MacroType type);
|
|
23774
|
-
|
|
23775
|
-
// MacroFunction(void);
|
|
23776
|
-
// The type
|
|
23777
|
-
MacroType type;
|
|
23778
|
-
//! The positional parameters
|
|
23779
|
-
vector<unique_ptr<ParsedExpression>> parameters;
|
|
23780
|
-
//! The default parameters and their associated values
|
|
23781
|
-
unordered_map<string, unique_ptr<ParsedExpression>> default_parameters;
|
|
23782
|
-
|
|
23783
|
-
public:
|
|
23784
|
-
virtual ~MacroFunction() {
|
|
23785
|
-
}
|
|
23786
23812
|
|
|
23787
|
-
void CopyProperties(MacroFunction &other);
|
|
23788
23813
|
|
|
23789
|
-
virtual unique_ptr<MacroFunction> Copy() = 0;
|
|
23790
23814
|
|
|
23791
|
-
static string ValidateArguments(MacroFunction ¯o_function, const string &name,
|
|
23792
|
-
FunctionExpression &function_expr,
|
|
23793
|
-
vector<unique_ptr<ParsedExpression>> &positionals,
|
|
23794
|
-
unordered_map<string, unique_ptr<ParsedExpression>> &defaults);
|
|
23795
|
-
};
|
|
23796
23815
|
|
|
23797
|
-
} // namespace duckdb
|
|
23798
23816
|
|
|
23799
23817
|
|
|
23800
23818
|
namespace duckdb {
|
|
23801
23819
|
|
|
23802
|
-
struct
|
|
23803
|
-
CreateMacroInfo() : CreateFunctionInfo(CatalogType::MACRO_ENTRY, INVALID_SCHEMA) {
|
|
23804
|
-
}
|
|
23820
|
+
struct CreateTypeInfo : public CreateInfo {
|
|
23805
23821
|
|
|
23806
|
-
|
|
23822
|
+
CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
|
|
23807
23823
|
}
|
|
23808
23824
|
|
|
23809
|
-
|
|
23825
|
+
//! Name of the Type
|
|
23826
|
+
string name;
|
|
23827
|
+
//! Logical Type
|
|
23828
|
+
LogicalType type;
|
|
23810
23829
|
|
|
23811
23830
|
public:
|
|
23812
23831
|
unique_ptr<CreateInfo> Copy() const override {
|
|
23813
|
-
auto result = make_unique<
|
|
23814
|
-
result->function = function->Copy();
|
|
23815
|
-
result->name = name;
|
|
23832
|
+
auto result = make_unique<CreateTypeInfo>();
|
|
23816
23833
|
CopyProperties(*result);
|
|
23834
|
+
result->name = name;
|
|
23835
|
+
result->type = type;
|
|
23817
23836
|
return move(result);
|
|
23818
23837
|
}
|
|
23819
23838
|
};
|
|
@@ -23905,7 +23924,7 @@ public:
|
|
|
23905
23924
|
//===----------------------------------------------------------------------===//
|
|
23906
23925
|
// DuckDB
|
|
23907
23926
|
//
|
|
23908
|
-
// duckdb/parser/
|
|
23927
|
+
// duckdb/parser/tableref/joinref.hpp
|
|
23909
23928
|
//
|
|
23910
23929
|
//
|
|
23911
23930
|
//===----------------------------------------------------------------------===//
|
|
@@ -23914,12 +23933,41 @@ public:
|
|
|
23914
23933
|
|
|
23915
23934
|
|
|
23916
23935
|
|
|
23936
|
+
|
|
23937
|
+
|
|
23938
|
+
|
|
23939
|
+
|
|
23917
23940
|
namespace duckdb {
|
|
23941
|
+
//! Represents a JOIN between two expressions
|
|
23942
|
+
class JoinRef : public TableRef {
|
|
23943
|
+
public:
|
|
23944
|
+
JoinRef() : TableRef(TableReferenceType::JOIN), is_natural(false) {
|
|
23945
|
+
}
|
|
23918
23946
|
|
|
23919
|
-
|
|
23920
|
-
|
|
23921
|
-
|
|
23947
|
+
//! The left hand side of the join
|
|
23948
|
+
unique_ptr<TableRef> left;
|
|
23949
|
+
//! The right hand side of the join
|
|
23950
|
+
unique_ptr<TableRef> right;
|
|
23951
|
+
//! The join condition
|
|
23952
|
+
unique_ptr<ParsedExpression> condition;
|
|
23953
|
+
//! The join type
|
|
23954
|
+
JoinType type;
|
|
23955
|
+
//! Natural join
|
|
23956
|
+
bool is_natural;
|
|
23957
|
+
//! The set of USING columns (if any)
|
|
23958
|
+
vector<string> using_columns;
|
|
23959
|
+
|
|
23960
|
+
public:
|
|
23961
|
+
string ToString() const override;
|
|
23962
|
+
bool Equals(const TableRef *other_p) const override;
|
|
23963
|
+
|
|
23964
|
+
unique_ptr<TableRef> Copy() override;
|
|
23922
23965
|
|
|
23966
|
+
//! Serializes a blob into a JoinRef
|
|
23967
|
+
void Serialize(FieldWriter &serializer) const override;
|
|
23968
|
+
//! Deserializes a blob back into a JoinRef
|
|
23969
|
+
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
23970
|
+
};
|
|
23923
23971
|
} // namespace duckdb
|
|
23924
23972
|
//===----------------------------------------------------------------------===//
|
|
23925
23973
|
// DuckDB
|
|
@@ -23952,10 +24000,11 @@ public:
|
|
|
23952
24000
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
23953
24001
|
};
|
|
23954
24002
|
} // namespace duckdb
|
|
24003
|
+
|
|
23955
24004
|
//===----------------------------------------------------------------------===//
|
|
23956
24005
|
// DuckDB
|
|
23957
24006
|
//
|
|
23958
|
-
// duckdb/parser/tableref/
|
|
24007
|
+
// duckdb/parser/tableref/crossproductref.hpp
|
|
23959
24008
|
//
|
|
23960
24009
|
//
|
|
23961
24010
|
//===----------------------------------------------------------------------===//
|
|
@@ -23964,34 +24013,32 @@ public:
|
|
|
23964
24013
|
|
|
23965
24014
|
|
|
23966
24015
|
|
|
23967
|
-
|
|
23968
|
-
|
|
23969
|
-
|
|
23970
24016
|
namespace duckdb {
|
|
23971
|
-
//! Represents a
|
|
23972
|
-
class
|
|
24017
|
+
//! Represents a cross product
|
|
24018
|
+
class CrossProductRef : public TableRef {
|
|
23973
24019
|
public:
|
|
23974
|
-
|
|
23975
|
-
|
|
23976
|
-
unique_ptr<ParsedExpression> function;
|
|
23977
|
-
vector<string> column_name_alias;
|
|
24020
|
+
CrossProductRef() : TableRef(TableReferenceType::CROSS_PRODUCT) {
|
|
24021
|
+
}
|
|
23978
24022
|
|
|
23979
|
-
|
|
23980
|
-
unique_ptr<
|
|
24023
|
+
//! The left hand side of the cross product
|
|
24024
|
+
unique_ptr<TableRef> left;
|
|
24025
|
+
//! The right hand side of the cross product
|
|
24026
|
+
unique_ptr<TableRef> right;
|
|
23981
24027
|
|
|
23982
24028
|
public:
|
|
23983
24029
|
string ToString() const override;
|
|
23984
|
-
|
|
23985
24030
|
bool Equals(const TableRef *other_p) const override;
|
|
23986
24031
|
|
|
23987
24032
|
unique_ptr<TableRef> Copy() override;
|
|
23988
24033
|
|
|
23989
|
-
//! Serializes a blob into a
|
|
24034
|
+
//! Serializes a blob into a CrossProductRef
|
|
23990
24035
|
void Serialize(FieldWriter &serializer) const override;
|
|
23991
|
-
//! Deserializes a blob back into a
|
|
24036
|
+
//! Deserializes a blob back into a CrossProductRef
|
|
23992
24037
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
23993
24038
|
};
|
|
23994
24039
|
} // namespace duckdb
|
|
24040
|
+
|
|
24041
|
+
|
|
23995
24042
|
//===----------------------------------------------------------------------===//
|
|
23996
24043
|
// DuckDB
|
|
23997
24044
|
//
|
|
@@ -24033,6 +24080,8 @@ public:
|
|
|
24033
24080
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
24034
24081
|
};
|
|
24035
24082
|
} // namespace duckdb
|
|
24083
|
+
|
|
24084
|
+
|
|
24036
24085
|
//===----------------------------------------------------------------------===//
|
|
24037
24086
|
// DuckDB
|
|
24038
24087
|
//
|
|
@@ -24073,46 +24122,7 @@ public:
|
|
|
24073
24122
|
//===----------------------------------------------------------------------===//
|
|
24074
24123
|
// DuckDB
|
|
24075
24124
|
//
|
|
24076
|
-
// duckdb/parser/tableref/
|
|
24077
|
-
//
|
|
24078
|
-
//
|
|
24079
|
-
//===----------------------------------------------------------------------===//
|
|
24080
|
-
|
|
24081
|
-
|
|
24082
|
-
|
|
24083
|
-
|
|
24084
|
-
|
|
24085
|
-
namespace duckdb {
|
|
24086
|
-
//! Represents a cross product
|
|
24087
|
-
class CrossProductRef : public TableRef {
|
|
24088
|
-
public:
|
|
24089
|
-
CrossProductRef() : TableRef(TableReferenceType::CROSS_PRODUCT) {
|
|
24090
|
-
}
|
|
24091
|
-
|
|
24092
|
-
//! The left hand side of the cross product
|
|
24093
|
-
unique_ptr<TableRef> left;
|
|
24094
|
-
//! The right hand side of the cross product
|
|
24095
|
-
unique_ptr<TableRef> right;
|
|
24096
|
-
|
|
24097
|
-
public:
|
|
24098
|
-
string ToString() const override;
|
|
24099
|
-
bool Equals(const TableRef *other_p) const override;
|
|
24100
|
-
|
|
24101
|
-
unique_ptr<TableRef> Copy() override;
|
|
24102
|
-
|
|
24103
|
-
//! Serializes a blob into a CrossProductRef
|
|
24104
|
-
void Serialize(FieldWriter &serializer) const override;
|
|
24105
|
-
//! Deserializes a blob back into a CrossProductRef
|
|
24106
|
-
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
24107
|
-
};
|
|
24108
|
-
} // namespace duckdb
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24112
|
-
//===----------------------------------------------------------------------===//
|
|
24113
|
-
// DuckDB
|
|
24114
|
-
//
|
|
24115
|
-
// duckdb/parser/tableref/joinref.hpp
|
|
24125
|
+
// duckdb/parser/tableref/table_function_ref.hpp
|
|
24116
24126
|
//
|
|
24117
24127
|
//
|
|
24118
24128
|
//===----------------------------------------------------------------------===//
|
|
@@ -24124,39 +24134,29 @@ public:
|
|
|
24124
24134
|
|
|
24125
24135
|
|
|
24126
24136
|
|
|
24127
|
-
|
|
24128
24137
|
namespace duckdb {
|
|
24129
|
-
//! Represents a
|
|
24130
|
-
class
|
|
24138
|
+
//! Represents a Table producing function
|
|
24139
|
+
class TableFunctionRef : public TableRef {
|
|
24131
24140
|
public:
|
|
24132
|
-
|
|
24133
|
-
}
|
|
24141
|
+
DUCKDB_API TableFunctionRef();
|
|
24134
24142
|
|
|
24135
|
-
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
unique_ptr<ParsedExpression> condition;
|
|
24141
|
-
//! The join type
|
|
24142
|
-
JoinType type;
|
|
24143
|
-
//! Natural join
|
|
24144
|
-
bool is_natural;
|
|
24145
|
-
//! The set of USING columns (if any)
|
|
24146
|
-
vector<string> using_columns;
|
|
24143
|
+
unique_ptr<ParsedExpression> function;
|
|
24144
|
+
vector<string> column_name_alias;
|
|
24145
|
+
|
|
24146
|
+
// if the function takes a subquery as argument its in here
|
|
24147
|
+
unique_ptr<SelectStatement> subquery;
|
|
24147
24148
|
|
|
24148
24149
|
public:
|
|
24149
24150
|
string ToString() const override;
|
|
24151
|
+
|
|
24150
24152
|
bool Equals(const TableRef *other_p) const override;
|
|
24151
24153
|
|
|
24152
24154
|
unique_ptr<TableRef> Copy() override;
|
|
24153
24155
|
|
|
24154
|
-
//! Serializes a blob into a
|
|
24156
|
+
//! Serializes a blob into a BaseTableRef
|
|
24155
24157
|
void Serialize(FieldWriter &serializer) const override;
|
|
24156
|
-
//! Deserializes a blob back into a
|
|
24158
|
+
//! Deserializes a blob back into a BaseTableRef
|
|
24157
24159
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
24158
24160
|
};
|
|
24159
24161
|
} // namespace duckdb
|
|
24160
24162
|
|
|
24161
|
-
|
|
24162
|
-
|