duckdb 0.3.2-dev1312.0 → 0.3.2-dev1323.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.cpp +14 -4
- package/src/duckdb.hpp +478 -478
- package/src/parquet-amalgamation.cpp +33690 -33690
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.2-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "d7a24678d"
|
|
15
|
+
#define DUCKDB_VERSION "v0.3.2-dev1323"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -21019,7 +21019,7 @@ private:
|
|
|
21019
21019
|
//===----------------------------------------------------------------------===//
|
|
21020
21020
|
// DuckDB
|
|
21021
21021
|
//
|
|
21022
|
-
// duckdb/parser/expression/
|
|
21022
|
+
// duckdb/parser/expression/lambda_expression.hpp
|
|
21023
21023
|
//
|
|
21024
21024
|
//
|
|
21025
21025
|
//===----------------------------------------------------------------------===//
|
|
@@ -21028,31 +21028,35 @@ private:
|
|
|
21028
21028
|
|
|
21029
21029
|
|
|
21030
21030
|
|
|
21031
|
+
|
|
21031
21032
|
namespace duckdb {
|
|
21032
|
-
|
|
21033
|
-
//!
|
|
21034
|
-
|
|
21033
|
+
|
|
21034
|
+
//! LambdaExpression represents a lambda operator that can be used for e.g. mapping an expression to a list
|
|
21035
|
+
//! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
|
|
21036
|
+
class LambdaExpression : public ParsedExpression {
|
|
21035
21037
|
public:
|
|
21036
|
-
|
|
21038
|
+
LambdaExpression(vector<string> parameters, unique_ptr<ParsedExpression> expression);
|
|
21037
21039
|
|
|
21038
|
-
|
|
21039
|
-
unique_ptr<ParsedExpression>
|
|
21040
|
+
vector<string> parameters;
|
|
21041
|
+
unique_ptr<ParsedExpression> expression;
|
|
21040
21042
|
|
|
21041
21043
|
public:
|
|
21042
21044
|
string ToString() const override;
|
|
21043
21045
|
|
|
21044
|
-
static bool Equals(const
|
|
21046
|
+
static bool Equals(const LambdaExpression *a, const LambdaExpression *b);
|
|
21047
|
+
hash_t Hash() const override;
|
|
21045
21048
|
|
|
21046
21049
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21047
21050
|
|
|
21048
21051
|
void Serialize(FieldWriter &writer) const override;
|
|
21049
21052
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21050
21053
|
};
|
|
21054
|
+
|
|
21051
21055
|
} // namespace duckdb
|
|
21052
21056
|
//===----------------------------------------------------------------------===//
|
|
21053
21057
|
// DuckDB
|
|
21054
21058
|
//
|
|
21055
|
-
// duckdb/parser/expression/
|
|
21059
|
+
// duckdb/parser/expression/case_expression.hpp
|
|
21056
21060
|
//
|
|
21057
21061
|
//
|
|
21058
21062
|
//===----------------------------------------------------------------------===//
|
|
@@ -21064,31 +21068,34 @@ public:
|
|
|
21064
21068
|
|
|
21065
21069
|
namespace duckdb {
|
|
21066
21070
|
|
|
21067
|
-
|
|
21068
|
-
|
|
21071
|
+
struct CaseCheck {
|
|
21072
|
+
unique_ptr<ParsedExpression> when_expr;
|
|
21073
|
+
unique_ptr<ParsedExpression> then_expr;
|
|
21074
|
+
};
|
|
21075
|
+
|
|
21076
|
+
//! The CaseExpression represents a CASE expression in the query
|
|
21077
|
+
class CaseExpression : public ParsedExpression {
|
|
21069
21078
|
public:
|
|
21070
|
-
|
|
21079
|
+
CaseExpression();
|
|
21071
21080
|
|
|
21072
|
-
|
|
21073
|
-
|
|
21081
|
+
vector<CaseCheck> case_checks;
|
|
21082
|
+
unique_ptr<ParsedExpression> else_expr;
|
|
21074
21083
|
|
|
21075
21084
|
public:
|
|
21076
21085
|
string ToString() const override;
|
|
21077
21086
|
|
|
21078
|
-
static bool Equals(const
|
|
21079
|
-
hash_t Hash() const override;
|
|
21087
|
+
static bool Equals(const CaseExpression *a, const CaseExpression *b);
|
|
21080
21088
|
|
|
21081
21089
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21082
21090
|
|
|
21083
21091
|
void Serialize(FieldWriter &writer) const override;
|
|
21084
21092
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21085
21093
|
};
|
|
21086
|
-
|
|
21087
21094
|
} // namespace duckdb
|
|
21088
21095
|
//===----------------------------------------------------------------------===//
|
|
21089
21096
|
// DuckDB
|
|
21090
21097
|
//
|
|
21091
|
-
// duckdb/parser/expression/
|
|
21098
|
+
// duckdb/parser/expression/conjunction_expression.hpp
|
|
21092
21099
|
//
|
|
21093
21100
|
//
|
|
21094
21101
|
//===----------------------------------------------------------------------===//
|
|
@@ -21099,19 +21106,22 @@ public:
|
|
|
21099
21106
|
|
|
21100
21107
|
|
|
21101
21108
|
namespace duckdb {
|
|
21102
|
-
|
|
21103
|
-
|
|
21109
|
+
|
|
21110
|
+
//! Represents a conjunction (AND/OR)
|
|
21111
|
+
class ConjunctionExpression : public ParsedExpression {
|
|
21104
21112
|
public:
|
|
21105
|
-
explicit
|
|
21106
|
-
|
|
21107
|
-
|
|
21113
|
+
explicit ConjunctionExpression(ExpressionType type);
|
|
21114
|
+
ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
|
|
21115
|
+
ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left, unique_ptr<ParsedExpression> right);
|
|
21108
21116
|
|
|
21109
21117
|
vector<unique_ptr<ParsedExpression>> children;
|
|
21110
21118
|
|
|
21111
21119
|
public:
|
|
21120
|
+
void AddExpression(unique_ptr<ParsedExpression> expr);
|
|
21121
|
+
|
|
21112
21122
|
string ToString() const override;
|
|
21113
21123
|
|
|
21114
|
-
static bool Equals(const
|
|
21124
|
+
static bool Equals(const ConjunctionExpression *a, const ConjunctionExpression *b);
|
|
21115
21125
|
|
|
21116
21126
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21117
21127
|
|
|
@@ -21122,7 +21132,7 @@ public:
|
|
|
21122
21132
|
//===----------------------------------------------------------------------===//
|
|
21123
21133
|
// DuckDB
|
|
21124
21134
|
//
|
|
21125
|
-
// duckdb/parser/expression/
|
|
21135
|
+
// duckdb/parser/expression/function_expression.hpp
|
|
21126
21136
|
//
|
|
21127
21137
|
//
|
|
21128
21138
|
//===----------------------------------------------------------------------===//
|
|
@@ -21134,34 +21144,68 @@ public:
|
|
|
21134
21144
|
|
|
21135
21145
|
|
|
21136
21146
|
namespace duckdb {
|
|
21147
|
+
//! Represents a function call
|
|
21148
|
+
class FunctionExpression : public ParsedExpression {
|
|
21149
|
+
public:
|
|
21150
|
+
FunctionExpression(string schema_name, const string &function_name, vector<unique_ptr<ParsedExpression>> children,
|
|
21151
|
+
unique_ptr<ParsedExpression> filter = nullptr, unique_ptr<OrderModifier> order_bys = nullptr,
|
|
21152
|
+
bool distinct = false, bool is_operator = false);
|
|
21153
|
+
FunctionExpression(const string &function_name, vector<unique_ptr<ParsedExpression>> children,
|
|
21154
|
+
unique_ptr<ParsedExpression> filter = nullptr, unique_ptr<OrderModifier> order_bys = nullptr,
|
|
21155
|
+
bool distinct = false, bool is_operator = false);
|
|
21156
|
+
|
|
21157
|
+
//! Schema of the function
|
|
21158
|
+
string schema;
|
|
21159
|
+
//! Function name
|
|
21160
|
+
string function_name;
|
|
21161
|
+
//! Whether or not the function is an operator, only used for rendering
|
|
21162
|
+
bool is_operator;
|
|
21163
|
+
//! List of arguments to the function
|
|
21164
|
+
vector<unique_ptr<ParsedExpression>> children;
|
|
21165
|
+
//! Whether or not the aggregate function is distinct, only used for aggregates
|
|
21166
|
+
bool distinct;
|
|
21167
|
+
//! Expression representing a filter, only used for aggregates
|
|
21168
|
+
unique_ptr<ParsedExpression> filter;
|
|
21169
|
+
//! Modifier representing an ORDER BY, only used for aggregates
|
|
21170
|
+
unique_ptr<OrderModifier> order_bys;
|
|
21137
21171
|
|
|
21138
|
-
//! Represents a subquery
|
|
21139
|
-
class SubqueryExpression : public ParsedExpression {
|
|
21140
21172
|
public:
|
|
21141
|
-
|
|
21173
|
+
string ToString() const override;
|
|
21142
21174
|
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
unique_ptr<ParsedExpression>
|
|
21150
|
-
|
|
21151
|
-
|
|
21175
|
+
unique_ptr<ParsedExpression> Copy() const override;
|
|
21176
|
+
|
|
21177
|
+
static bool Equals(const FunctionExpression *a, const FunctionExpression *b);
|
|
21178
|
+
hash_t Hash() const override;
|
|
21179
|
+
|
|
21180
|
+
void Serialize(FieldWriter &writer) const override;
|
|
21181
|
+
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21182
|
+
};
|
|
21183
|
+
} // namespace duckdb
|
|
21184
|
+
//===----------------------------------------------------------------------===//
|
|
21185
|
+
// DuckDB
|
|
21186
|
+
//
|
|
21187
|
+
// duckdb/parser/expression/default_expression.hpp
|
|
21188
|
+
//
|
|
21189
|
+
//
|
|
21190
|
+
//===----------------------------------------------------------------------===//
|
|
21191
|
+
|
|
21192
|
+
|
|
21193
|
+
|
|
21194
|
+
|
|
21195
|
+
|
|
21196
|
+
namespace duckdb {
|
|
21197
|
+
//! Represents the default value of a column
|
|
21198
|
+
class DefaultExpression : public ParsedExpression {
|
|
21199
|
+
public:
|
|
21200
|
+
DefaultExpression();
|
|
21152
21201
|
|
|
21153
21202
|
public:
|
|
21154
|
-
bool HasSubquery() const override {
|
|
21155
|
-
return true;
|
|
21156
|
-
}
|
|
21157
21203
|
bool IsScalar() const override {
|
|
21158
21204
|
return false;
|
|
21159
21205
|
}
|
|
21160
21206
|
|
|
21161
21207
|
string ToString() const override;
|
|
21162
21208
|
|
|
21163
|
-
static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
|
|
21164
|
-
|
|
21165
21209
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21166
21210
|
|
|
21167
21211
|
void Serialize(FieldWriter &writer) const override;
|
|
@@ -21171,7 +21215,7 @@ public:
|
|
|
21171
21215
|
//===----------------------------------------------------------------------===//
|
|
21172
21216
|
// DuckDB
|
|
21173
21217
|
//
|
|
21174
|
-
// duckdb/parser/expression/
|
|
21218
|
+
// duckdb/parser/expression/comparison_expression.hpp
|
|
21175
21219
|
//
|
|
21176
21220
|
//
|
|
21177
21221
|
//===----------------------------------------------------------------------===//
|
|
@@ -21180,24 +21224,20 @@ public:
|
|
|
21180
21224
|
|
|
21181
21225
|
|
|
21182
21226
|
|
|
21183
|
-
|
|
21184
21227
|
namespace duckdb {
|
|
21185
|
-
|
|
21186
|
-
//!
|
|
21187
|
-
class
|
|
21228
|
+
//! ComparisonExpression represents a boolean comparison (e.g. =, >=, <>). Always returns a boolean
|
|
21229
|
+
//! and has two children.
|
|
21230
|
+
class ComparisonExpression : public ParsedExpression {
|
|
21188
21231
|
public:
|
|
21189
|
-
|
|
21190
|
-
ConjunctionExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
|
|
21191
|
-
ConjunctionExpression(ExpressionType type, unique_ptr<ParsedExpression> left, unique_ptr<ParsedExpression> right);
|
|
21232
|
+
ComparisonExpression(ExpressionType type, unique_ptr<ParsedExpression> left, unique_ptr<ParsedExpression> right);
|
|
21192
21233
|
|
|
21193
|
-
|
|
21234
|
+
unique_ptr<ParsedExpression> left;
|
|
21235
|
+
unique_ptr<ParsedExpression> right;
|
|
21194
21236
|
|
|
21195
21237
|
public:
|
|
21196
|
-
void AddExpression(unique_ptr<ParsedExpression> expr);
|
|
21197
|
-
|
|
21198
21238
|
string ToString() const override;
|
|
21199
21239
|
|
|
21200
|
-
static bool Equals(const
|
|
21240
|
+
static bool Equals(const ComparisonExpression *a, const ComparisonExpression *b);
|
|
21201
21241
|
|
|
21202
21242
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21203
21243
|
|
|
@@ -21208,7 +21248,7 @@ public:
|
|
|
21208
21248
|
//===----------------------------------------------------------------------===//
|
|
21209
21249
|
// DuckDB
|
|
21210
21250
|
//
|
|
21211
|
-
// duckdb/parser/expression/
|
|
21251
|
+
// duckdb/parser/expression/constant_expression.hpp
|
|
21212
21252
|
//
|
|
21213
21253
|
//
|
|
21214
21254
|
//===----------------------------------------------------------------------===//
|
|
@@ -21217,32 +21257,34 @@ public:
|
|
|
21217
21257
|
|
|
21218
21258
|
|
|
21219
21259
|
|
|
21260
|
+
|
|
21220
21261
|
namespace duckdb {
|
|
21221
21262
|
|
|
21222
|
-
|
|
21263
|
+
//! ConstantExpression represents a constant value in the query
|
|
21264
|
+
class ConstantExpression : public ParsedExpression {
|
|
21223
21265
|
public:
|
|
21224
|
-
|
|
21225
|
-
unique_ptr<ParsedExpression> upper);
|
|
21266
|
+
explicit ConstantExpression(Value val);
|
|
21226
21267
|
|
|
21227
|
-
|
|
21228
|
-
|
|
21229
|
-
unique_ptr<ParsedExpression> upper;
|
|
21268
|
+
//! The constant value referenced
|
|
21269
|
+
Value value;
|
|
21230
21270
|
|
|
21231
21271
|
public:
|
|
21232
21272
|
string ToString() const override;
|
|
21233
21273
|
|
|
21234
|
-
static bool Equals(const
|
|
21274
|
+
static bool Equals(const ConstantExpression *a, const ConstantExpression *b);
|
|
21275
|
+
hash_t Hash() const override;
|
|
21235
21276
|
|
|
21236
21277
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21237
21278
|
|
|
21238
21279
|
void Serialize(FieldWriter &writer) const override;
|
|
21239
21280
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21240
21281
|
};
|
|
21282
|
+
|
|
21241
21283
|
} // namespace duckdb
|
|
21242
21284
|
//===----------------------------------------------------------------------===//
|
|
21243
21285
|
// DuckDB
|
|
21244
21286
|
//
|
|
21245
|
-
// duckdb/parser/expression/
|
|
21287
|
+
// duckdb/parser/expression/operator_expression.hpp
|
|
21246
21288
|
//
|
|
21247
21289
|
//
|
|
21248
21290
|
//===----------------------------------------------------------------------===//
|
|
@@ -21251,25 +21293,23 @@ public:
|
|
|
21251
21293
|
|
|
21252
21294
|
|
|
21253
21295
|
|
|
21296
|
+
|
|
21254
21297
|
namespace duckdb {
|
|
21255
|
-
|
|
21298
|
+
//! Represents a built-in operator expression
|
|
21299
|
+
class OperatorExpression : public ParsedExpression {
|
|
21256
21300
|
public:
|
|
21257
|
-
|
|
21301
|
+
explicit OperatorExpression(ExpressionType type, unique_ptr<ParsedExpression> left = nullptr,
|
|
21302
|
+
unique_ptr<ParsedExpression> right = nullptr);
|
|
21303
|
+
OperatorExpression(ExpressionType type, vector<unique_ptr<ParsedExpression>> children);
|
|
21258
21304
|
|
|
21259
|
-
|
|
21305
|
+
vector<unique_ptr<ParsedExpression>> children;
|
|
21260
21306
|
|
|
21261
21307
|
public:
|
|
21262
|
-
bool IsScalar() const override {
|
|
21263
|
-
return true;
|
|
21264
|
-
}
|
|
21265
|
-
bool HasParameter() const override {
|
|
21266
|
-
return true;
|
|
21267
|
-
}
|
|
21268
|
-
|
|
21269
21308
|
string ToString() const override;
|
|
21270
21309
|
|
|
21310
|
+
static bool Equals(const OperatorExpression *a, const OperatorExpression *b);
|
|
21311
|
+
|
|
21271
21312
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21272
|
-
hash_t Hash() const override;
|
|
21273
21313
|
|
|
21274
21314
|
void Serialize(FieldWriter &writer) const override;
|
|
21275
21315
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
@@ -21278,7 +21318,7 @@ public:
|
|
|
21278
21318
|
//===----------------------------------------------------------------------===//
|
|
21279
21319
|
// DuckDB
|
|
21280
21320
|
//
|
|
21281
|
-
// duckdb/parser/expression/
|
|
21321
|
+
// duckdb/parser/expression/between_expression.hpp
|
|
21282
21322
|
//
|
|
21283
21323
|
//
|
|
21284
21324
|
//===----------------------------------------------------------------------===//
|
|
@@ -21287,25 +21327,21 @@ public:
|
|
|
21287
21327
|
|
|
21288
21328
|
|
|
21289
21329
|
|
|
21290
|
-
|
|
21291
21330
|
namespace duckdb {
|
|
21292
21331
|
|
|
21293
|
-
|
|
21294
|
-
class StarExpression : public ParsedExpression {
|
|
21332
|
+
class BetweenExpression : public ParsedExpression {
|
|
21295
21333
|
public:
|
|
21296
|
-
|
|
21334
|
+
BetweenExpression(unique_ptr<ParsedExpression> input, unique_ptr<ParsedExpression> lower,
|
|
21335
|
+
unique_ptr<ParsedExpression> upper);
|
|
21297
21336
|
|
|
21298
|
-
|
|
21299
|
-
|
|
21300
|
-
|
|
21301
|
-
case_insensitive_set_t exclude_list;
|
|
21302
|
-
//! List of columns to replace with another expression
|
|
21303
|
-
case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
|
|
21337
|
+
unique_ptr<ParsedExpression> input;
|
|
21338
|
+
unique_ptr<ParsedExpression> lower;
|
|
21339
|
+
unique_ptr<ParsedExpression> upper;
|
|
21304
21340
|
|
|
21305
21341
|
public:
|
|
21306
21342
|
string ToString() const override;
|
|
21307
21343
|
|
|
21308
|
-
static bool Equals(const
|
|
21344
|
+
static bool Equals(const BetweenExpression *a, const BetweenExpression *b);
|
|
21309
21345
|
|
|
21310
21346
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21311
21347
|
|
|
@@ -21316,7 +21352,7 @@ public:
|
|
|
21316
21352
|
//===----------------------------------------------------------------------===//
|
|
21317
21353
|
// DuckDB
|
|
21318
21354
|
//
|
|
21319
|
-
// duckdb/parser/expression/
|
|
21355
|
+
// duckdb/parser/expression/positional_reference_expression.hpp
|
|
21320
21356
|
//
|
|
21321
21357
|
//
|
|
21322
21358
|
//===----------------------------------------------------------------------===//
|
|
@@ -21325,33 +21361,31 @@ public:
|
|
|
21325
21361
|
|
|
21326
21362
|
|
|
21327
21363
|
|
|
21328
|
-
|
|
21329
21364
|
namespace duckdb {
|
|
21330
|
-
|
|
21331
|
-
struct CaseCheck {
|
|
21332
|
-
unique_ptr<ParsedExpression> when_expr;
|
|
21333
|
-
unique_ptr<ParsedExpression> then_expr;
|
|
21334
|
-
};
|
|
21335
|
-
|
|
21336
|
-
//! The CaseExpression represents a CASE expression in the query
|
|
21337
|
-
class CaseExpression : public ParsedExpression {
|
|
21365
|
+
class PositionalReferenceExpression : public ParsedExpression {
|
|
21338
21366
|
public:
|
|
21339
|
-
|
|
21367
|
+
PositionalReferenceExpression(idx_t index);
|
|
21340
21368
|
|
|
21341
|
-
|
|
21342
|
-
unique_ptr<ParsedExpression> else_expr;
|
|
21369
|
+
idx_t index;
|
|
21343
21370
|
|
|
21344
21371
|
public:
|
|
21345
|
-
|
|
21372
|
+
bool IsScalar() const override {
|
|
21373
|
+
return false;
|
|
21374
|
+
}
|
|
21346
21375
|
|
|
21347
|
-
|
|
21376
|
+
string ToString() const override;
|
|
21348
21377
|
|
|
21378
|
+
static bool Equals(const PositionalReferenceExpression *a, const PositionalReferenceExpression *b);
|
|
21349
21379
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21380
|
+
hash_t Hash() const override;
|
|
21350
21381
|
|
|
21351
21382
|
void Serialize(FieldWriter &writer) const override;
|
|
21352
21383
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21353
21384
|
};
|
|
21354
21385
|
} // namespace duckdb
|
|
21386
|
+
|
|
21387
|
+
|
|
21388
|
+
|
|
21355
21389
|
//===----------------------------------------------------------------------===//
|
|
21356
21390
|
// DuckDB
|
|
21357
21391
|
//
|
|
@@ -21390,10 +21424,11 @@ public:
|
|
|
21390
21424
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21391
21425
|
};
|
|
21392
21426
|
} // namespace duckdb
|
|
21427
|
+
|
|
21393
21428
|
//===----------------------------------------------------------------------===//
|
|
21394
21429
|
// DuckDB
|
|
21395
21430
|
//
|
|
21396
|
-
// duckdb/parser/expression/
|
|
21431
|
+
// duckdb/parser/expression/collate_expression.hpp
|
|
21397
21432
|
//
|
|
21398
21433
|
//
|
|
21399
21434
|
//===----------------------------------------------------------------------===//
|
|
@@ -21403,31 +21438,41 @@ public:
|
|
|
21403
21438
|
|
|
21404
21439
|
|
|
21405
21440
|
namespace duckdb {
|
|
21406
|
-
|
|
21441
|
+
|
|
21442
|
+
//! CollateExpression represents a COLLATE statement
|
|
21443
|
+
class CollateExpression : public ParsedExpression {
|
|
21407
21444
|
public:
|
|
21408
|
-
|
|
21445
|
+
CollateExpression(string collation, unique_ptr<ParsedExpression> child);
|
|
21409
21446
|
|
|
21410
|
-
|
|
21447
|
+
//! The child of the cast expression
|
|
21448
|
+
unique_ptr<ParsedExpression> child;
|
|
21449
|
+
//! The collation clause
|
|
21450
|
+
string collation;
|
|
21411
21451
|
|
|
21412
21452
|
public:
|
|
21413
|
-
bool IsScalar() const override {
|
|
21414
|
-
return false;
|
|
21415
|
-
}
|
|
21416
|
-
|
|
21417
21453
|
string ToString() const override;
|
|
21418
21454
|
|
|
21419
|
-
static bool Equals(const
|
|
21420
|
-
|
|
21421
|
-
|
|
21455
|
+
static bool Equals(const CollateExpression *a, const CollateExpression *b);
|
|
21456
|
+
|
|
21457
|
+
unique_ptr<ParsedExpression> Copy() const override;
|
|
21422
21458
|
|
|
21423
21459
|
void Serialize(FieldWriter &writer) const override;
|
|
21424
21460
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21425
21461
|
};
|
|
21426
21462
|
} // namespace duckdb
|
|
21463
|
+
|
|
21464
|
+
|
|
21465
|
+
|
|
21466
|
+
|
|
21467
|
+
|
|
21468
|
+
|
|
21469
|
+
|
|
21470
|
+
|
|
21471
|
+
|
|
21427
21472
|
//===----------------------------------------------------------------------===//
|
|
21428
21473
|
// DuckDB
|
|
21429
21474
|
//
|
|
21430
|
-
// duckdb/parser/expression/
|
|
21475
|
+
// duckdb/parser/expression/parameter_expression.hpp
|
|
21431
21476
|
//
|
|
21432
21477
|
//
|
|
21433
21478
|
//===----------------------------------------------------------------------===//
|
|
@@ -21436,39 +21481,36 @@ public:
|
|
|
21436
21481
|
|
|
21437
21482
|
|
|
21438
21483
|
|
|
21439
|
-
|
|
21440
21484
|
namespace duckdb {
|
|
21441
|
-
|
|
21442
|
-
//! LambdaExpression represents a lambda operator that can be used for e.g. mapping an expression to a list
|
|
21443
|
-
//! Lambda expressions are written in the form of "capture -> expr", e.g. "x -> x + 1"
|
|
21444
|
-
class LambdaExpression : public ParsedExpression {
|
|
21485
|
+
class ParameterExpression : public ParsedExpression {
|
|
21445
21486
|
public:
|
|
21446
|
-
|
|
21487
|
+
ParameterExpression();
|
|
21447
21488
|
|
|
21448
|
-
|
|
21449
|
-
unique_ptr<ParsedExpression> expression;
|
|
21489
|
+
idx_t parameter_nr;
|
|
21450
21490
|
|
|
21451
21491
|
public:
|
|
21452
|
-
|
|
21492
|
+
bool IsScalar() const override {
|
|
21493
|
+
return true;
|
|
21494
|
+
}
|
|
21495
|
+
bool HasParameter() const override {
|
|
21496
|
+
return true;
|
|
21497
|
+
}
|
|
21453
21498
|
|
|
21454
|
-
|
|
21455
|
-
hash_t Hash() const override;
|
|
21499
|
+
string ToString() const override;
|
|
21456
21500
|
|
|
21457
21501
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21502
|
+
hash_t Hash() const override;
|
|
21458
21503
|
|
|
21459
21504
|
void Serialize(FieldWriter &writer) const override;
|
|
21460
21505
|
static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
|
|
21461
21506
|
};
|
|
21462
|
-
|
|
21463
21507
|
} // namespace duckdb
|
|
21464
21508
|
|
|
21465
21509
|
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
21510
|
//===----------------------------------------------------------------------===//
|
|
21469
21511
|
// DuckDB
|
|
21470
21512
|
//
|
|
21471
|
-
// duckdb/parser/expression/
|
|
21513
|
+
// duckdb/parser/expression/star_expression.hpp
|
|
21472
21514
|
//
|
|
21473
21515
|
//
|
|
21474
21516
|
//===----------------------------------------------------------------------===//
|
|
@@ -21477,22 +21519,25 @@ public:
|
|
|
21477
21519
|
|
|
21478
21520
|
|
|
21479
21521
|
|
|
21522
|
+
|
|
21480
21523
|
namespace duckdb {
|
|
21481
21524
|
|
|
21482
|
-
//!
|
|
21483
|
-
class
|
|
21525
|
+
//! Represents a * expression in the SELECT clause
|
|
21526
|
+
class StarExpression : public ParsedExpression {
|
|
21484
21527
|
public:
|
|
21485
|
-
|
|
21528
|
+
StarExpression(string relation_name = string());
|
|
21486
21529
|
|
|
21487
|
-
//! The
|
|
21488
|
-
|
|
21489
|
-
//!
|
|
21490
|
-
|
|
21530
|
+
//! The relation name in case of tbl.*, or empty if this is a normal *
|
|
21531
|
+
string relation_name;
|
|
21532
|
+
//! List of columns to exclude from the STAR expression
|
|
21533
|
+
case_insensitive_set_t exclude_list;
|
|
21534
|
+
//! List of columns to replace with another expression
|
|
21535
|
+
case_insensitive_map_t<unique_ptr<ParsedExpression>> replace_list;
|
|
21491
21536
|
|
|
21492
21537
|
public:
|
|
21493
21538
|
string ToString() const override;
|
|
21494
21539
|
|
|
21495
|
-
static bool Equals(const
|
|
21540
|
+
static bool Equals(const StarExpression *a, const StarExpression *b);
|
|
21496
21541
|
|
|
21497
21542
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21498
21543
|
|
|
@@ -21501,14 +21546,10 @@ public:
|
|
|
21501
21546
|
};
|
|
21502
21547
|
} // namespace duckdb
|
|
21503
21548
|
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
21549
|
//===----------------------------------------------------------------------===//
|
|
21509
21550
|
// DuckDB
|
|
21510
21551
|
//
|
|
21511
|
-
// duckdb/parser/expression/
|
|
21552
|
+
// duckdb/parser/expression/subquery_expression.hpp
|
|
21512
21553
|
//
|
|
21513
21554
|
//
|
|
21514
21555
|
//===----------------------------------------------------------------------===//
|
|
@@ -21517,19 +21558,37 @@ public:
|
|
|
21517
21558
|
|
|
21518
21559
|
|
|
21519
21560
|
|
|
21561
|
+
|
|
21562
|
+
|
|
21520
21563
|
namespace duckdb {
|
|
21521
|
-
|
|
21522
|
-
|
|
21564
|
+
|
|
21565
|
+
//! Represents a subquery
|
|
21566
|
+
class SubqueryExpression : public ParsedExpression {
|
|
21523
21567
|
public:
|
|
21524
|
-
|
|
21568
|
+
SubqueryExpression();
|
|
21569
|
+
|
|
21570
|
+
//! The actual subquery
|
|
21571
|
+
unique_ptr<SelectStatement> subquery;
|
|
21572
|
+
//! The subquery type
|
|
21573
|
+
SubqueryType subquery_type;
|
|
21574
|
+
//! the child expression to compare with (in case of IN, ANY, ALL operators, empty for EXISTS queries and scalar
|
|
21575
|
+
//! subquery)
|
|
21576
|
+
unique_ptr<ParsedExpression> child;
|
|
21577
|
+
//! The comparison type of the child expression with the subquery (in case of ANY, ALL operators), empty otherwise
|
|
21578
|
+
ExpressionType comparison_type;
|
|
21525
21579
|
|
|
21526
21580
|
public:
|
|
21581
|
+
bool HasSubquery() const override {
|
|
21582
|
+
return true;
|
|
21583
|
+
}
|
|
21527
21584
|
bool IsScalar() const override {
|
|
21528
21585
|
return false;
|
|
21529
21586
|
}
|
|
21530
21587
|
|
|
21531
21588
|
string ToString() const override;
|
|
21532
21589
|
|
|
21590
|
+
static bool Equals(const SubqueryExpression *a, const SubqueryExpression *b);
|
|
21591
|
+
|
|
21533
21592
|
unique_ptr<ParsedExpression> Copy() const override;
|
|
21534
21593
|
|
|
21535
21594
|
void Serialize(FieldWriter &writer) const override;
|
|
@@ -21537,10 +21596,11 @@ public:
|
|
|
21537
21596
|
};
|
|
21538
21597
|
} // namespace duckdb
|
|
21539
21598
|
|
|
21599
|
+
|
|
21540
21600
|
//===----------------------------------------------------------------------===//
|
|
21541
21601
|
// DuckDB
|
|
21542
21602
|
//
|
|
21543
|
-
// duckdb/parser/
|
|
21603
|
+
// duckdb/parser/parsed_data/create_collation_info.hpp
|
|
21544
21604
|
//
|
|
21545
21605
|
//
|
|
21546
21606
|
//===----------------------------------------------------------------------===//
|
|
@@ -21550,57 +21610,105 @@ public:
|
|
|
21550
21610
|
|
|
21551
21611
|
|
|
21552
21612
|
|
|
21553
|
-
|
|
21554
21613
|
namespace duckdb {
|
|
21555
|
-
//! Represents a function call
|
|
21556
|
-
class FunctionExpression : public ParsedExpression {
|
|
21557
|
-
public:
|
|
21558
|
-
FunctionExpression(string schema_name, const string &function_name, vector<unique_ptr<ParsedExpression>> children,
|
|
21559
|
-
unique_ptr<ParsedExpression> filter = nullptr, unique_ptr<OrderModifier> order_bys = nullptr,
|
|
21560
|
-
bool distinct = false, bool is_operator = false);
|
|
21561
|
-
FunctionExpression(const string &function_name, vector<unique_ptr<ParsedExpression>> children,
|
|
21562
|
-
unique_ptr<ParsedExpression> filter = nullptr, unique_ptr<OrderModifier> order_bys = nullptr,
|
|
21563
|
-
bool distinct = false, bool is_operator = false);
|
|
21564
21614
|
|
|
21565
|
-
|
|
21566
|
-
string
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21615
|
+
struct CreateCollationInfo : public CreateInfo {
|
|
21616
|
+
CreateCollationInfo(string name_p, ScalarFunction function_p, bool combinable_p, bool not_required_for_equality_p)
|
|
21617
|
+
: CreateInfo(CatalogType::COLLATION_ENTRY), function(move(function_p)), combinable(combinable_p),
|
|
21618
|
+
not_required_for_equality(not_required_for_equality_p) {
|
|
21619
|
+
this->name = move(name_p);
|
|
21620
|
+
}
|
|
21621
|
+
|
|
21622
|
+
//! The name of the collation
|
|
21623
|
+
string name;
|
|
21624
|
+
//! The collation function to push in case collation is required
|
|
21625
|
+
ScalarFunction function;
|
|
21626
|
+
//! Whether or not the collation can be combined with other collations.
|
|
21627
|
+
bool combinable;
|
|
21628
|
+
//! Whether or not the collation is required for equality comparisons or not. For many collations a binary
|
|
21629
|
+
//! comparison for equality comparisons is correct, allowing us to skip the collation in these cases which greatly
|
|
21630
|
+
//! speeds up processing.
|
|
21631
|
+
bool not_required_for_equality;
|
|
21579
21632
|
|
|
21580
21633
|
public:
|
|
21581
|
-
|
|
21634
|
+
unique_ptr<CreateInfo> Copy() const override {
|
|
21635
|
+
auto result = make_unique<CreateCollationInfo>(name, function, combinable, not_required_for_equality);
|
|
21636
|
+
CopyProperties(*result);
|
|
21637
|
+
return move(result);
|
|
21638
|
+
}
|
|
21639
|
+
};
|
|
21582
21640
|
|
|
21583
|
-
|
|
21641
|
+
} // namespace duckdb
|
|
21642
|
+
//===----------------------------------------------------------------------===//
|
|
21643
|
+
// DuckDB
|
|
21644
|
+
//
|
|
21645
|
+
// duckdb/parser/parsed_data/vacuum_info.hpp
|
|
21646
|
+
//
|
|
21647
|
+
//
|
|
21648
|
+
//===----------------------------------------------------------------------===//
|
|
21584
21649
|
|
|
21585
|
-
static bool Equals(const FunctionExpression *a, const FunctionExpression *b);
|
|
21586
|
-
hash_t Hash() const override;
|
|
21587
21650
|
|
|
21588
|
-
|
|
21589
|
-
|
|
21651
|
+
|
|
21652
|
+
|
|
21653
|
+
|
|
21654
|
+
namespace duckdb {
|
|
21655
|
+
|
|
21656
|
+
enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
|
|
21657
|
+
|
|
21658
|
+
struct LoadInfo : public ParseInfo {
|
|
21659
|
+
std::string filename;
|
|
21660
|
+
LoadType load_type;
|
|
21661
|
+
|
|
21662
|
+
public:
|
|
21663
|
+
unique_ptr<LoadInfo> Copy() const {
|
|
21664
|
+
auto result = make_unique<LoadInfo>();
|
|
21665
|
+
result->filename = filename;
|
|
21666
|
+
result->load_type = load_type;
|
|
21667
|
+
return result;
|
|
21668
|
+
}
|
|
21590
21669
|
};
|
|
21670
|
+
|
|
21591
21671
|
} // namespace duckdb
|
|
21672
|
+
//===----------------------------------------------------------------------===//
|
|
21673
|
+
// DuckDB
|
|
21674
|
+
//
|
|
21675
|
+
// duckdb/parser/parsed_data/show_select_info.hpp
|
|
21676
|
+
//
|
|
21677
|
+
//
|
|
21678
|
+
//===----------------------------------------------------------------------===//
|
|
21592
21679
|
|
|
21593
21680
|
|
|
21594
21681
|
|
|
21595
21682
|
|
|
21596
21683
|
|
|
21597
21684
|
|
|
21685
|
+
namespace duckdb {
|
|
21598
21686
|
|
|
21687
|
+
struct ShowSelectInfo : public ParseInfo {
|
|
21688
|
+
//! Types of projected columns
|
|
21689
|
+
vector<LogicalType> types;
|
|
21690
|
+
//! The QueryNode of select query
|
|
21691
|
+
unique_ptr<QueryNode> query;
|
|
21692
|
+
//! Aliases of projected columns
|
|
21693
|
+
vector<string> aliases;
|
|
21694
|
+
//! Whether or not we are requesting a summary or a describe
|
|
21695
|
+
bool is_summary;
|
|
21599
21696
|
|
|
21697
|
+
unique_ptr<ShowSelectInfo> Copy() {
|
|
21698
|
+
auto result = make_unique<ShowSelectInfo>();
|
|
21699
|
+
result->types = types;
|
|
21700
|
+
result->query = query->Copy();
|
|
21701
|
+
result->aliases = aliases;
|
|
21702
|
+
result->is_summary = is_summary;
|
|
21703
|
+
return result;
|
|
21704
|
+
}
|
|
21705
|
+
};
|
|
21706
|
+
|
|
21707
|
+
} // namespace duckdb
|
|
21600
21708
|
//===----------------------------------------------------------------------===//
|
|
21601
21709
|
// DuckDB
|
|
21602
21710
|
//
|
|
21603
|
-
// duckdb/parser/parsed_data/
|
|
21711
|
+
// duckdb/parser/parsed_data/create_aggregate_function_info.hpp
|
|
21604
21712
|
//
|
|
21605
21713
|
//
|
|
21606
21714
|
//===----------------------------------------------------------------------===//
|
|
@@ -21612,25 +21720,26 @@ public:
|
|
|
21612
21720
|
|
|
21613
21721
|
namespace duckdb {
|
|
21614
21722
|
|
|
21615
|
-
struct
|
|
21616
|
-
explicit
|
|
21617
|
-
: CreateFunctionInfo(CatalogType::
|
|
21618
|
-
functions.push_back(move(function));
|
|
21723
|
+
struct CreateAggregateFunctionInfo : public CreateFunctionInfo {
|
|
21724
|
+
explicit CreateAggregateFunctionInfo(AggregateFunction function)
|
|
21725
|
+
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(function.name) {
|
|
21619
21726
|
this->name = function.name;
|
|
21727
|
+
functions.AddFunction(move(function));
|
|
21620
21728
|
}
|
|
21621
|
-
|
|
21622
|
-
|
|
21623
|
-
|
|
21624
|
-
|
|
21625
|
-
|
|
21729
|
+
|
|
21730
|
+
explicit CreateAggregateFunctionInfo(AggregateFunctionSet set)
|
|
21731
|
+
: CreateFunctionInfo(CatalogType::AGGREGATE_FUNCTION_ENTRY), functions(move(set)) {
|
|
21732
|
+
this->name = functions.name;
|
|
21733
|
+
for (auto &func : functions.functions) {
|
|
21734
|
+
func.name = functions.name;
|
|
21626
21735
|
}
|
|
21627
21736
|
}
|
|
21628
21737
|
|
|
21629
|
-
|
|
21738
|
+
AggregateFunctionSet functions;
|
|
21630
21739
|
|
|
21631
21740
|
public:
|
|
21632
21741
|
unique_ptr<CreateInfo> Copy() const override {
|
|
21633
|
-
auto result = make_unique<
|
|
21742
|
+
auto result = make_unique<CreateAggregateFunctionInfo>(functions);
|
|
21634
21743
|
CopyProperties(*result);
|
|
21635
21744
|
return move(result);
|
|
21636
21745
|
}
|
|
@@ -21640,7 +21749,7 @@ public:
|
|
|
21640
21749
|
//===----------------------------------------------------------------------===//
|
|
21641
21750
|
// DuckDB
|
|
21642
21751
|
//
|
|
21643
|
-
// duckdb/parser/parsed_data/
|
|
21752
|
+
// duckdb/parser/parsed_data/create_type_info.hpp
|
|
21644
21753
|
//
|
|
21645
21754
|
//
|
|
21646
21755
|
//===----------------------------------------------------------------------===//
|
|
@@ -21650,30 +21759,26 @@ public:
|
|
|
21650
21759
|
|
|
21651
21760
|
|
|
21652
21761
|
|
|
21762
|
+
|
|
21763
|
+
|
|
21653
21764
|
namespace duckdb {
|
|
21654
21765
|
|
|
21655
|
-
struct
|
|
21656
|
-
|
|
21657
|
-
|
|
21658
|
-
not_required_for_equality(not_required_for_equality_p) {
|
|
21659
|
-
this->name = move(name_p);
|
|
21766
|
+
struct CreateTypeInfo : public CreateInfo {
|
|
21767
|
+
|
|
21768
|
+
CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
|
|
21660
21769
|
}
|
|
21661
21770
|
|
|
21662
|
-
//!
|
|
21771
|
+
//! Name of the Type
|
|
21663
21772
|
string name;
|
|
21664
|
-
//!
|
|
21665
|
-
|
|
21666
|
-
//! Whether or not the collation can be combined with other collations.
|
|
21667
|
-
bool combinable;
|
|
21668
|
-
//! Whether or not the collation is required for equality comparisons or not. For many collations a binary
|
|
21669
|
-
//! comparison for equality comparisons is correct, allowing us to skip the collation in these cases which greatly
|
|
21670
|
-
//! speeds up processing.
|
|
21671
|
-
bool not_required_for_equality;
|
|
21773
|
+
//! Logical Type
|
|
21774
|
+
LogicalType type;
|
|
21672
21775
|
|
|
21673
21776
|
public:
|
|
21674
21777
|
unique_ptr<CreateInfo> Copy() const override {
|
|
21675
|
-
auto result = make_unique<
|
|
21778
|
+
auto result = make_unique<CreateTypeInfo>();
|
|
21676
21779
|
CopyProperties(*result);
|
|
21780
|
+
result->name = name;
|
|
21781
|
+
result->type = type;
|
|
21677
21782
|
return move(result);
|
|
21678
21783
|
}
|
|
21679
21784
|
};
|
|
@@ -21682,7 +21787,7 @@ public:
|
|
|
21682
21787
|
//===----------------------------------------------------------------------===//
|
|
21683
21788
|
// DuckDB
|
|
21684
21789
|
//
|
|
21685
|
-
// duckdb/parser/parsed_data/
|
|
21790
|
+
// duckdb/parser/parsed_data/vacuum_info.hpp
|
|
21686
21791
|
//
|
|
21687
21792
|
//
|
|
21688
21793
|
//===----------------------------------------------------------------------===//
|
|
@@ -21693,16 +21798,8 @@ public:
|
|
|
21693
21798
|
|
|
21694
21799
|
namespace duckdb {
|
|
21695
21800
|
|
|
21696
|
-
struct
|
|
21697
|
-
|
|
21698
|
-
}
|
|
21699
|
-
|
|
21700
|
-
public:
|
|
21701
|
-
unique_ptr<CreateInfo> Copy() const override {
|
|
21702
|
-
auto result = make_unique<CreateSchemaInfo>();
|
|
21703
|
-
CopyProperties(*result);
|
|
21704
|
-
return move(result);
|
|
21705
|
-
}
|
|
21801
|
+
struct VacuumInfo : public ParseInfo {
|
|
21802
|
+
// nothing for now
|
|
21706
21803
|
};
|
|
21707
21804
|
|
|
21708
21805
|
} // namespace duckdb
|
|
@@ -21778,7 +21875,18 @@ struct TransactionInfo : public ParseInfo {
|
|
|
21778
21875
|
//===----------------------------------------------------------------------===//
|
|
21779
21876
|
// DuckDB
|
|
21780
21877
|
//
|
|
21781
|
-
// duckdb/parser/parsed_data/
|
|
21878
|
+
// duckdb/parser/parsed_data/create_macro_info.hpp
|
|
21879
|
+
//
|
|
21880
|
+
//
|
|
21881
|
+
//===----------------------------------------------------------------------===//
|
|
21882
|
+
|
|
21883
|
+
|
|
21884
|
+
|
|
21885
|
+
|
|
21886
|
+
//===----------------------------------------------------------------------===//
|
|
21887
|
+
// DuckDB
|
|
21888
|
+
//
|
|
21889
|
+
// duckdb/function/macro_function.hpp
|
|
21782
21890
|
//
|
|
21783
21891
|
//
|
|
21784
21892
|
//===----------------------------------------------------------------------===//
|
|
@@ -21788,28 +21896,74 @@ struct TransactionInfo : public ParseInfo {
|
|
|
21788
21896
|
|
|
21789
21897
|
|
|
21790
21898
|
|
|
21899
|
+
|
|
21900
|
+
|
|
21791
21901
|
namespace duckdb {
|
|
21792
21902
|
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21903
|
+
class MacroCatalogEntry;
|
|
21904
|
+
|
|
21905
|
+
class MacroFunction {
|
|
21906
|
+
public:
|
|
21907
|
+
explicit MacroFunction(unique_ptr<ParsedExpression> expression);
|
|
21908
|
+
|
|
21909
|
+
//! Check whether the supplied arguments are valid
|
|
21910
|
+
static string ValidateArguments(MacroCatalogEntry ¯o_func, FunctionExpression &function_expr,
|
|
21911
|
+
vector<unique_ptr<ParsedExpression>> &positionals,
|
|
21912
|
+
unordered_map<string, unique_ptr<ParsedExpression>> &defaults);
|
|
21913
|
+
//! The macro expression
|
|
21914
|
+
unique_ptr<ParsedExpression> expression;
|
|
21915
|
+
//! The positional parameters
|
|
21916
|
+
vector<unique_ptr<ParsedExpression>> parameters;
|
|
21917
|
+
//! The default parameters and their associated values
|
|
21918
|
+
unordered_map<string, unique_ptr<ParsedExpression>> default_parameters;
|
|
21919
|
+
|
|
21920
|
+
public:
|
|
21921
|
+
unique_ptr<MacroFunction> Copy();
|
|
21922
|
+
};
|
|
21923
|
+
|
|
21924
|
+
} // namespace duckdb
|
|
21925
|
+
|
|
21926
|
+
|
|
21927
|
+
namespace duckdb {
|
|
21928
|
+
|
|
21929
|
+
struct CreateMacroInfo : public CreateFunctionInfo {
|
|
21930
|
+
CreateMacroInfo() : CreateFunctionInfo(CatalogType::MACRO_ENTRY, INVALID_SCHEMA) {
|
|
21798
21931
|
}
|
|
21799
21932
|
|
|
21800
|
-
|
|
21801
|
-
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21933
|
+
unique_ptr<MacroFunction> function;
|
|
21934
|
+
|
|
21935
|
+
public:
|
|
21936
|
+
unique_ptr<CreateInfo> Copy() const override {
|
|
21937
|
+
auto result = make_unique<CreateMacroInfo>();
|
|
21938
|
+
result->function = function->Copy();
|
|
21939
|
+
result->name = name;
|
|
21940
|
+
CopyProperties(*result);
|
|
21941
|
+
return move(result);
|
|
21806
21942
|
}
|
|
21943
|
+
};
|
|
21944
|
+
|
|
21945
|
+
} // namespace duckdb
|
|
21946
|
+
//===----------------------------------------------------------------------===//
|
|
21947
|
+
// DuckDB
|
|
21948
|
+
//
|
|
21949
|
+
// duckdb/parser/parsed_data/create_schema_info.hpp
|
|
21950
|
+
//
|
|
21951
|
+
//
|
|
21952
|
+
//===----------------------------------------------------------------------===//
|
|
21953
|
+
|
|
21807
21954
|
|
|
21808
|
-
|
|
21955
|
+
|
|
21956
|
+
|
|
21957
|
+
|
|
21958
|
+
namespace duckdb {
|
|
21959
|
+
|
|
21960
|
+
struct CreateSchemaInfo : public CreateInfo {
|
|
21961
|
+
CreateSchemaInfo() : CreateInfo(CatalogType::SCHEMA_ENTRY) {
|
|
21962
|
+
}
|
|
21809
21963
|
|
|
21810
21964
|
public:
|
|
21811
21965
|
unique_ptr<CreateInfo> Copy() const override {
|
|
21812
|
-
auto result = make_unique<
|
|
21966
|
+
auto result = make_unique<CreateSchemaInfo>();
|
|
21813
21967
|
CopyProperties(*result);
|
|
21814
21968
|
return move(result);
|
|
21815
21969
|
}
|
|
@@ -21880,99 +22034,25 @@ struct CreateIndexInfo : public CreateInfo {
|
|
|
21880
22034
|
//! Index Type (e.g., B+-tree, Skip-List, ...)
|
|
21881
22035
|
IndexType index_type;
|
|
21882
22036
|
//! Name of the Index
|
|
21883
|
-
string index_name;
|
|
21884
|
-
//! If it is an unique index
|
|
21885
|
-
bool unique = false;
|
|
21886
|
-
//! The table to create the index on
|
|
21887
|
-
unique_ptr<BaseTableRef> table;
|
|
21888
|
-
//! Set of expressions to index by
|
|
21889
|
-
vector<unique_ptr<ParsedExpression>> expressions;
|
|
21890
|
-
|
|
21891
|
-
public:
|
|
21892
|
-
unique_ptr<CreateInfo> Copy() const override {
|
|
21893
|
-
auto result = make_unique<CreateIndexInfo>();
|
|
21894
|
-
CopyProperties(*result);
|
|
21895
|
-
result->index_type = index_type;
|
|
21896
|
-
result->index_name = index_name;
|
|
21897
|
-
result->unique = unique;
|
|
21898
|
-
result->table = unique_ptr_cast<TableRef, BaseTableRef>(table->Copy());
|
|
21899
|
-
for (auto &expr : expressions) {
|
|
21900
|
-
result->expressions.push_back(expr->Copy());
|
|
21901
|
-
}
|
|
21902
|
-
return move(result);
|
|
21903
|
-
}
|
|
21904
|
-
};
|
|
21905
|
-
|
|
21906
|
-
} // namespace duckdb
|
|
21907
|
-
//===----------------------------------------------------------------------===//
|
|
21908
|
-
// DuckDB
|
|
21909
|
-
//
|
|
21910
|
-
// duckdb/parser/parsed_data/show_select_info.hpp
|
|
21911
|
-
//
|
|
21912
|
-
//
|
|
21913
|
-
//===----------------------------------------------------------------------===//
|
|
21914
|
-
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
|
|
21918
|
-
|
|
21919
|
-
|
|
21920
|
-
namespace duckdb {
|
|
21921
|
-
|
|
21922
|
-
struct ShowSelectInfo : public ParseInfo {
|
|
21923
|
-
//! Types of projected columns
|
|
21924
|
-
vector<LogicalType> types;
|
|
21925
|
-
//! The QueryNode of select query
|
|
21926
|
-
unique_ptr<QueryNode> query;
|
|
21927
|
-
//! Aliases of projected columns
|
|
21928
|
-
vector<string> aliases;
|
|
21929
|
-
//! Whether or not we are requesting a summary or a describe
|
|
21930
|
-
bool is_summary;
|
|
21931
|
-
|
|
21932
|
-
unique_ptr<ShowSelectInfo> Copy() {
|
|
21933
|
-
auto result = make_unique<ShowSelectInfo>();
|
|
21934
|
-
result->types = types;
|
|
21935
|
-
result->query = query->Copy();
|
|
21936
|
-
result->aliases = aliases;
|
|
21937
|
-
result->is_summary = is_summary;
|
|
21938
|
-
return result;
|
|
21939
|
-
}
|
|
21940
|
-
};
|
|
21941
|
-
|
|
21942
|
-
} // namespace duckdb
|
|
21943
|
-
//===----------------------------------------------------------------------===//
|
|
21944
|
-
// DuckDB
|
|
21945
|
-
//
|
|
21946
|
-
// duckdb/parser/parsed_data/create_type_info.hpp
|
|
21947
|
-
//
|
|
21948
|
-
//
|
|
21949
|
-
//===----------------------------------------------------------------------===//
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
21957
|
-
|
|
21958
|
-
namespace duckdb {
|
|
21959
|
-
|
|
21960
|
-
struct CreateTypeInfo : public CreateInfo {
|
|
21961
|
-
|
|
21962
|
-
CreateTypeInfo() : CreateInfo(CatalogType::TYPE_ENTRY) {
|
|
21963
|
-
}
|
|
21964
|
-
|
|
21965
|
-
//! Name of the Type
|
|
21966
|
-
string name;
|
|
21967
|
-
//! Logical Type
|
|
21968
|
-
LogicalType type;
|
|
22037
|
+
string index_name;
|
|
22038
|
+
//! If it is an unique index
|
|
22039
|
+
bool unique = false;
|
|
22040
|
+
//! The table to create the index on
|
|
22041
|
+
unique_ptr<BaseTableRef> table;
|
|
22042
|
+
//! Set of expressions to index by
|
|
22043
|
+
vector<unique_ptr<ParsedExpression>> expressions;
|
|
21969
22044
|
|
|
21970
22045
|
public:
|
|
21971
22046
|
unique_ptr<CreateInfo> Copy() const override {
|
|
21972
|
-
auto result = make_unique<
|
|
22047
|
+
auto result = make_unique<CreateIndexInfo>();
|
|
21973
22048
|
CopyProperties(*result);
|
|
21974
|
-
result->
|
|
21975
|
-
result->
|
|
22049
|
+
result->index_type = index_type;
|
|
22050
|
+
result->index_name = index_name;
|
|
22051
|
+
result->unique = unique;
|
|
22052
|
+
result->table = unique_ptr_cast<TableRef, BaseTableRef>(table->Copy());
|
|
22053
|
+
for (auto &expr : expressions) {
|
|
22054
|
+
result->expressions.push_back(expr->Copy());
|
|
22055
|
+
}
|
|
21976
22056
|
return move(result);
|
|
21977
22057
|
}
|
|
21978
22058
|
};
|
|
@@ -21981,18 +22061,7 @@ public:
|
|
|
21981
22061
|
//===----------------------------------------------------------------------===//
|
|
21982
22062
|
// DuckDB
|
|
21983
22063
|
//
|
|
21984
|
-
// duckdb/parser/parsed_data/
|
|
21985
|
-
//
|
|
21986
|
-
//
|
|
21987
|
-
//===----------------------------------------------------------------------===//
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
//===----------------------------------------------------------------------===//
|
|
21993
|
-
// DuckDB
|
|
21994
|
-
//
|
|
21995
|
-
// duckdb/function/macro_function.hpp
|
|
22064
|
+
// duckdb/parser/parsed_data/create_pragma_function_info.hpp
|
|
21996
22065
|
//
|
|
21997
22066
|
//
|
|
21998
22067
|
//===----------------------------------------------------------------------===//
|
|
@@ -22002,47 +22071,27 @@ public:
|
|
|
22002
22071
|
|
|
22003
22072
|
|
|
22004
22073
|
|
|
22005
|
-
|
|
22006
|
-
|
|
22007
|
-
namespace duckdb {
|
|
22008
|
-
|
|
22009
|
-
class MacroCatalogEntry;
|
|
22010
|
-
|
|
22011
|
-
class MacroFunction {
|
|
22012
|
-
public:
|
|
22013
|
-
explicit MacroFunction(unique_ptr<ParsedExpression> expression);
|
|
22014
|
-
|
|
22015
|
-
//! Check whether the supplied arguments are valid
|
|
22016
|
-
static string ValidateArguments(MacroCatalogEntry ¯o_func, FunctionExpression &function_expr,
|
|
22017
|
-
vector<unique_ptr<ParsedExpression>> &positionals,
|
|
22018
|
-
unordered_map<string, unique_ptr<ParsedExpression>> &defaults);
|
|
22019
|
-
//! The macro expression
|
|
22020
|
-
unique_ptr<ParsedExpression> expression;
|
|
22021
|
-
//! The positional parameters
|
|
22022
|
-
vector<unique_ptr<ParsedExpression>> parameters;
|
|
22023
|
-
//! The default parameters and their associated values
|
|
22024
|
-
unordered_map<string, unique_ptr<ParsedExpression>> default_parameters;
|
|
22025
|
-
|
|
22026
|
-
public:
|
|
22027
|
-
unique_ptr<MacroFunction> Copy();
|
|
22028
|
-
};
|
|
22029
|
-
|
|
22030
|
-
} // namespace duckdb
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
22074
|
namespace duckdb {
|
|
22034
22075
|
|
|
22035
|
-
struct
|
|
22036
|
-
|
|
22076
|
+
struct CreatePragmaFunctionInfo : public CreateFunctionInfo {
|
|
22077
|
+
explicit CreatePragmaFunctionInfo(PragmaFunction function)
|
|
22078
|
+
: CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY) {
|
|
22079
|
+
functions.push_back(move(function));
|
|
22080
|
+
this->name = function.name;
|
|
22081
|
+
}
|
|
22082
|
+
CreatePragmaFunctionInfo(string name, vector<PragmaFunction> functions_)
|
|
22083
|
+
: CreateFunctionInfo(CatalogType::PRAGMA_FUNCTION_ENTRY), functions(move(functions_)) {
|
|
22084
|
+
this->name = name;
|
|
22085
|
+
for (auto &function : functions) {
|
|
22086
|
+
function.name = name;
|
|
22087
|
+
}
|
|
22037
22088
|
}
|
|
22038
22089
|
|
|
22039
|
-
|
|
22090
|
+
vector<PragmaFunction> functions;
|
|
22040
22091
|
|
|
22041
22092
|
public:
|
|
22042
22093
|
unique_ptr<CreateInfo> Copy() const override {
|
|
22043
|
-
auto result = make_unique<
|
|
22044
|
-
result->function = function->Copy();
|
|
22045
|
-
result->name = name;
|
|
22094
|
+
auto result = make_unique<CreatePragmaFunctionInfo>(functions[0].name, functions);
|
|
22046
22095
|
CopyProperties(*result);
|
|
22047
22096
|
return move(result);
|
|
22048
22097
|
}
|
|
@@ -22079,25 +22128,6 @@ struct BoundExportData : public ParseInfo {
|
|
|
22079
22128
|
unordered_map<TableCatalogEntry *, ExportedTableData> data;
|
|
22080
22129
|
};
|
|
22081
22130
|
|
|
22082
|
-
} // namespace duckdb
|
|
22083
|
-
//===----------------------------------------------------------------------===//
|
|
22084
|
-
// DuckDB
|
|
22085
|
-
//
|
|
22086
|
-
// duckdb/parser/parsed_data/vacuum_info.hpp
|
|
22087
|
-
//
|
|
22088
|
-
//
|
|
22089
|
-
//===----------------------------------------------------------------------===//
|
|
22090
|
-
|
|
22091
|
-
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22095
|
-
namespace duckdb {
|
|
22096
|
-
|
|
22097
|
-
struct VacuumInfo : public ParseInfo {
|
|
22098
|
-
// nothing for now
|
|
22099
|
-
};
|
|
22100
|
-
|
|
22101
22131
|
} // namespace duckdb
|
|
22102
22132
|
//===----------------------------------------------------------------------===//
|
|
22103
22133
|
// DuckDB
|
|
@@ -22145,7 +22175,7 @@ public:
|
|
|
22145
22175
|
//===----------------------------------------------------------------------===//
|
|
22146
22176
|
// DuckDB
|
|
22147
22177
|
//
|
|
22148
|
-
// duckdb/parser/
|
|
22178
|
+
// duckdb/parser/tableref/table_function_ref.hpp
|
|
22149
22179
|
//
|
|
22150
22180
|
//
|
|
22151
22181
|
//===----------------------------------------------------------------------===//
|
|
@@ -22154,56 +22184,32 @@ public:
|
|
|
22154
22184
|
|
|
22155
22185
|
|
|
22156
22186
|
|
|
22157
|
-
namespace duckdb {
|
|
22158
22187
|
|
|
22159
|
-
enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
|
|
22160
22188
|
|
|
22161
|
-
struct LoadInfo : public ParseInfo {
|
|
22162
|
-
std::string filename;
|
|
22163
|
-
LoadType load_type;
|
|
22164
22189
|
|
|
22190
|
+
namespace duckdb {
|
|
22191
|
+
//! Represents a Table producing function
|
|
22192
|
+
class TableFunctionRef : public TableRef {
|
|
22165
22193
|
public:
|
|
22166
|
-
|
|
22167
|
-
auto result = make_unique<LoadInfo>();
|
|
22168
|
-
result->filename = filename;
|
|
22169
|
-
result->load_type = load_type;
|
|
22170
|
-
return result;
|
|
22194
|
+
TableFunctionRef() : TableRef(TableReferenceType::TABLE_FUNCTION) {
|
|
22171
22195
|
}
|
|
22172
|
-
};
|
|
22173
|
-
|
|
22174
|
-
} // namespace duckdb
|
|
22175
|
-
//===----------------------------------------------------------------------===//
|
|
22176
|
-
// DuckDB
|
|
22177
|
-
//
|
|
22178
|
-
// duckdb/parser/tableref/subqueryref.hpp
|
|
22179
|
-
//
|
|
22180
|
-
//
|
|
22181
|
-
//===----------------------------------------------------------------------===//
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
22196
|
|
|
22197
|
+
unique_ptr<ParsedExpression> function;
|
|
22198
|
+
vector<string> column_name_alias;
|
|
22187
22199
|
|
|
22188
|
-
|
|
22189
|
-
//! Represents a subquery
|
|
22190
|
-
class SubqueryRef : public TableRef {
|
|
22191
|
-
public:
|
|
22192
|
-
explicit SubqueryRef(unique_ptr<SelectStatement> subquery, string alias = string());
|
|
22193
|
-
|
|
22194
|
-
//! The subquery
|
|
22200
|
+
// if the function takes a subquery as argument its in here
|
|
22195
22201
|
unique_ptr<SelectStatement> subquery;
|
|
22196
|
-
//! Aliases for the column names
|
|
22197
|
-
vector<string> column_name_alias;
|
|
22198
22202
|
|
|
22199
22203
|
public:
|
|
22204
|
+
string ToString() const override;
|
|
22205
|
+
|
|
22200
22206
|
bool Equals(const TableRef *other_p) const override;
|
|
22201
22207
|
|
|
22202
22208
|
unique_ptr<TableRef> Copy() override;
|
|
22203
22209
|
|
|
22204
|
-
//! Serializes a blob into a
|
|
22210
|
+
//! Serializes a blob into a BaseTableRef
|
|
22205
22211
|
void Serialize(FieldWriter &serializer) const override;
|
|
22206
|
-
//! Deserializes a blob back into a
|
|
22212
|
+
//! Deserializes a blob back into a BaseTableRef
|
|
22207
22213
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
22208
22214
|
};
|
|
22209
22215
|
} // namespace duckdb
|
|
@@ -22245,7 +22251,7 @@ public:
|
|
|
22245
22251
|
//===----------------------------------------------------------------------===//
|
|
22246
22252
|
// DuckDB
|
|
22247
22253
|
//
|
|
22248
|
-
// duckdb/parser/tableref/
|
|
22254
|
+
// duckdb/parser/tableref/emptytableref.hpp
|
|
22249
22255
|
//
|
|
22250
22256
|
//
|
|
22251
22257
|
//===----------------------------------------------------------------------===//
|
|
@@ -22254,47 +22260,31 @@ public:
|
|
|
22254
22260
|
|
|
22255
22261
|
|
|
22256
22262
|
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
22263
|
namespace duckdb {
|
|
22262
|
-
//! Represents a
|
|
22263
|
-
class
|
|
22264
|
+
//! Represents a cross product
|
|
22265
|
+
class EmptyTableRef : public TableRef {
|
|
22264
22266
|
public:
|
|
22265
|
-
|
|
22267
|
+
EmptyTableRef() : TableRef(TableReferenceType::EMPTY) {
|
|
22266
22268
|
}
|
|
22267
22269
|
|
|
22268
|
-
//! The left hand side of the join
|
|
22269
|
-
unique_ptr<TableRef> left;
|
|
22270
|
-
//! The right hand side of the join
|
|
22271
|
-
unique_ptr<TableRef> right;
|
|
22272
|
-
//! The join condition
|
|
22273
|
-
unique_ptr<ParsedExpression> condition;
|
|
22274
|
-
//! The join type
|
|
22275
|
-
JoinType type;
|
|
22276
|
-
//! Natural join
|
|
22277
|
-
bool is_natural;
|
|
22278
|
-
//! The set of USING columns (if any)
|
|
22279
|
-
vector<string> using_columns;
|
|
22280
|
-
|
|
22281
22270
|
public:
|
|
22282
22271
|
bool Equals(const TableRef *other_p) const override;
|
|
22283
22272
|
|
|
22284
22273
|
unique_ptr<TableRef> Copy() override;
|
|
22285
22274
|
|
|
22286
|
-
//! Serializes a blob into a
|
|
22275
|
+
//! Serializes a blob into a DummyTableRef
|
|
22287
22276
|
void Serialize(FieldWriter &serializer) const override;
|
|
22288
|
-
//! Deserializes a blob back into a
|
|
22277
|
+
//! Deserializes a blob back into a DummyTableRef
|
|
22289
22278
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
22290
22279
|
};
|
|
22291
22280
|
} // namespace duckdb
|
|
22292
22281
|
|
|
22293
22282
|
|
|
22283
|
+
|
|
22294
22284
|
//===----------------------------------------------------------------------===//
|
|
22295
22285
|
// DuckDB
|
|
22296
22286
|
//
|
|
22297
|
-
// duckdb/parser/tableref/
|
|
22287
|
+
// duckdb/parser/tableref/expressionlistref.hpp
|
|
22298
22288
|
//
|
|
22299
22289
|
//
|
|
22300
22290
|
//===----------------------------------------------------------------------===//
|
|
@@ -22303,21 +22293,31 @@ public:
|
|
|
22303
22293
|
|
|
22304
22294
|
|
|
22305
22295
|
|
|
22296
|
+
|
|
22297
|
+
|
|
22298
|
+
|
|
22306
22299
|
namespace duckdb {
|
|
22307
|
-
//! Represents a
|
|
22308
|
-
class
|
|
22300
|
+
//! Represents an expression list as generated by a VALUES statement
|
|
22301
|
+
class ExpressionListRef : public TableRef {
|
|
22309
22302
|
public:
|
|
22310
|
-
|
|
22303
|
+
ExpressionListRef() : TableRef(TableReferenceType::EXPRESSION_LIST) {
|
|
22311
22304
|
}
|
|
22312
22305
|
|
|
22306
|
+
//! Value list, only used for VALUES statement
|
|
22307
|
+
vector<vector<unique_ptr<ParsedExpression>>> values;
|
|
22308
|
+
//! Expected SQL types
|
|
22309
|
+
vector<LogicalType> expected_types;
|
|
22310
|
+
//! The set of expected names
|
|
22311
|
+
vector<string> expected_names;
|
|
22312
|
+
|
|
22313
22313
|
public:
|
|
22314
22314
|
bool Equals(const TableRef *other_p) const override;
|
|
22315
22315
|
|
|
22316
22316
|
unique_ptr<TableRef> Copy() override;
|
|
22317
22317
|
|
|
22318
|
-
//! Serializes a blob into a
|
|
22318
|
+
//! Serializes a blob into a ExpressionListRef
|
|
22319
22319
|
void Serialize(FieldWriter &serializer) const override;
|
|
22320
|
-
//! Deserializes a blob back into a
|
|
22320
|
+
//! Deserializes a blob back into a ExpressionListRef
|
|
22321
22321
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
22322
22322
|
};
|
|
22323
22323
|
} // namespace duckdb
|
|
@@ -22325,7 +22325,7 @@ public:
|
|
|
22325
22325
|
//===----------------------------------------------------------------------===//
|
|
22326
22326
|
// DuckDB
|
|
22327
22327
|
//
|
|
22328
|
-
// duckdb/parser/tableref/
|
|
22328
|
+
// duckdb/parser/tableref/joinref.hpp
|
|
22329
22329
|
//
|
|
22330
22330
|
//
|
|
22331
22331
|
//===----------------------------------------------------------------------===//
|
|
@@ -22337,38 +22337,43 @@ public:
|
|
|
22337
22337
|
|
|
22338
22338
|
|
|
22339
22339
|
|
|
22340
|
+
|
|
22340
22341
|
namespace duckdb {
|
|
22341
|
-
//! Represents
|
|
22342
|
-
class
|
|
22342
|
+
//! Represents a JOIN between two expressions
|
|
22343
|
+
class JoinRef : public TableRef {
|
|
22343
22344
|
public:
|
|
22344
|
-
|
|
22345
|
+
JoinRef() : TableRef(TableReferenceType::JOIN), is_natural(false) {
|
|
22345
22346
|
}
|
|
22346
22347
|
|
|
22347
|
-
//!
|
|
22348
|
-
|
|
22349
|
-
//!
|
|
22350
|
-
|
|
22351
|
-
//! The
|
|
22352
|
-
|
|
22348
|
+
//! The left hand side of the join
|
|
22349
|
+
unique_ptr<TableRef> left;
|
|
22350
|
+
//! The right hand side of the join
|
|
22351
|
+
unique_ptr<TableRef> right;
|
|
22352
|
+
//! The join condition
|
|
22353
|
+
unique_ptr<ParsedExpression> condition;
|
|
22354
|
+
//! The join type
|
|
22355
|
+
JoinType type;
|
|
22356
|
+
//! Natural join
|
|
22357
|
+
bool is_natural;
|
|
22358
|
+
//! The set of USING columns (if any)
|
|
22359
|
+
vector<string> using_columns;
|
|
22353
22360
|
|
|
22354
22361
|
public:
|
|
22355
22362
|
bool Equals(const TableRef *other_p) const override;
|
|
22356
22363
|
|
|
22357
22364
|
unique_ptr<TableRef> Copy() override;
|
|
22358
22365
|
|
|
22359
|
-
//! Serializes a blob into a
|
|
22366
|
+
//! Serializes a blob into a JoinRef
|
|
22360
22367
|
void Serialize(FieldWriter &serializer) const override;
|
|
22361
|
-
//! Deserializes a blob back into a
|
|
22368
|
+
//! Deserializes a blob back into a JoinRef
|
|
22362
22369
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
22363
22370
|
};
|
|
22364
22371
|
} // namespace duckdb
|
|
22365
22372
|
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
22373
|
//===----------------------------------------------------------------------===//
|
|
22369
22374
|
// DuckDB
|
|
22370
22375
|
//
|
|
22371
|
-
// duckdb/parser/tableref/
|
|
22376
|
+
// duckdb/parser/tableref/subqueryref.hpp
|
|
22372
22377
|
//
|
|
22373
22378
|
//
|
|
22374
22379
|
//===----------------------------------------------------------------------===//
|
|
@@ -22378,32 +22383,27 @@ public:
|
|
|
22378
22383
|
|
|
22379
22384
|
|
|
22380
22385
|
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
22386
|
namespace duckdb {
|
|
22384
|
-
//! Represents a
|
|
22385
|
-
class
|
|
22387
|
+
//! Represents a subquery
|
|
22388
|
+
class SubqueryRef : public TableRef {
|
|
22386
22389
|
public:
|
|
22387
|
-
|
|
22388
|
-
}
|
|
22389
|
-
|
|
22390
|
-
unique_ptr<ParsedExpression> function;
|
|
22391
|
-
vector<string> column_name_alias;
|
|
22390
|
+
explicit SubqueryRef(unique_ptr<SelectStatement> subquery, string alias = string());
|
|
22392
22391
|
|
|
22393
|
-
|
|
22392
|
+
//! The subquery
|
|
22394
22393
|
unique_ptr<SelectStatement> subquery;
|
|
22394
|
+
//! Aliases for the column names
|
|
22395
|
+
vector<string> column_name_alias;
|
|
22395
22396
|
|
|
22396
22397
|
public:
|
|
22397
|
-
string ToString() const override;
|
|
22398
|
-
|
|
22399
22398
|
bool Equals(const TableRef *other_p) const override;
|
|
22400
22399
|
|
|
22401
22400
|
unique_ptr<TableRef> Copy() override;
|
|
22402
22401
|
|
|
22403
|
-
//! Serializes a blob into a
|
|
22402
|
+
//! Serializes a blob into a SubqueryRef
|
|
22404
22403
|
void Serialize(FieldWriter &serializer) const override;
|
|
22405
|
-
//! Deserializes a blob back into a
|
|
22404
|
+
//! Deserializes a blob back into a SubqueryRef
|
|
22406
22405
|
static unique_ptr<TableRef> Deserialize(FieldReader &source);
|
|
22407
22406
|
};
|
|
22408
22407
|
} // namespace duckdb
|
|
22409
22408
|
|
|
22409
|
+
|