Skip to content

Commit 1769ca7

Browse files
mbasmanovafacebook-github-bot
authored andcommitted
misc: Add XxxNodePtr aliases for all plan nodes (facebookincubator#13848)
Summary: Pull Request resolved: facebookincubator#13848 Reviewed By: xiaoxmeng, kKPulla Differential Revision: D77148982 fbshipit-source-id: 824f073a54e0e760f1fa69aa7fee8528d8c9f9a1
1 parent 122802a commit 1769ca7

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

velox/core/PlanNode.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ class ArrowStreamNode : public PlanNode {
498498
std::shared_ptr<ArrowArrayStream> arrowStream_;
499499
};
500500

501+
using ArrowStreamNodePtr = std::shared_ptr<const ArrowStreamNode>;
502+
501503
class TraceScanNode final : public PlanNode {
502504
public:
503505
TraceScanNode(
@@ -614,6 +616,8 @@ class TraceScanNode final : public PlanNode {
614616
const RowTypePtr outputType_;
615617
};
616618

619+
using TraceScanNodePtr = std::shared_ptr<const TraceScanNode>;
620+
617621
class FilterNode : public PlanNode {
618622
public:
619623
FilterNode(const PlanNodeId& id, TypedExprPtr filter, PlanNodePtr source)
@@ -706,6 +710,8 @@ class FilterNode : public PlanNode {
706710
const TypedExprPtr filter_;
707711
};
708712

713+
using FilterNodePtr = std::shared_ptr<const FilterNode>;
714+
709715
class AbstractProjectNode : public PlanNode {
710716
public:
711717
AbstractProjectNode(
@@ -876,6 +882,8 @@ class ProjectNode : public AbstractProjectNode {
876882
static PlanNodePtr create(const folly::dynamic& obj, void* context);
877883
};
878884

885+
using ProjectNodePtr = std::shared_ptr<const ProjectNode>;
886+
879887
class TableScanNode : public PlanNode {
880888
public:
881889
TableScanNode(
@@ -1529,6 +1537,8 @@ class TableWriteNode : public PlanNode {
15291537
const connector::CommitStrategy commitStrategy_;
15301538
};
15311539

1540+
using TableWriteNodePtr = std::shared_ptr<const TableWriteNode>;
1541+
15321542
class TableWriteMergeNode : public PlanNode {
15331543
public:
15341544
/// 'outputType' specifies the type to store the metadata of table write
@@ -1632,6 +1642,8 @@ class TableWriteMergeNode : public PlanNode {
16321642
const RowTypePtr outputType_;
16331643
};
16341644

1645+
using TableWriteMergeNodePtr = std::shared_ptr<const TableWriteMergeNode>;
1646+
16351647
/// For each input row, generates N rows with M columns according to
16361648
/// specified 'projections'. 'projections' is an N x M matrix of expressions:
16371649
/// a vector of N rows each having M columns. Each expression is either a
@@ -1735,6 +1747,8 @@ class ExpandNode : public PlanNode {
17351747
const std::vector<std::vector<TypedExprPtr>> projections_;
17361748
};
17371749

1750+
using ExpandNodePtr = std::shared_ptr<const ExpandNode>;
1751+
17381752
/// Plan node used to implement aggregations over grouping sets. Duplicates
17391753
/// the aggregation input for each set of grouping keys. The output contains
17401754
/// one column for each grouping key, followed by aggregation inputs, followed
@@ -1903,6 +1917,8 @@ class GroupIdNode : public PlanNode {
19031917
const std::string groupIdName_;
19041918
};
19051919

1920+
using GroupIdNodePtr = std::shared_ptr<const GroupIdNode>;
1921+
19061922
class ExchangeNode : public PlanNode {
19071923
public:
19081924
ExchangeNode(
@@ -1989,6 +2005,8 @@ class ExchangeNode : public PlanNode {
19892005
const VectorSerde::Kind serdeKind_;
19902006
};
19912007

2008+
using ExchangeNodePtr = std::shared_ptr<const ExchangeNode>;
2009+
19922010
class MergeExchangeNode : public ExchangeNode {
19932011
public:
19942012
MergeExchangeNode(
@@ -2089,6 +2107,8 @@ class MergeExchangeNode : public ExchangeNode {
20892107
const std::vector<SortOrder> sortingOrders_;
20902108
};
20912109

2110+
using MergeExchangeNodePtr = std::shared_ptr<const MergeExchangeNode>;
2111+
20922112
class LocalMergeNode : public PlanNode {
20932113
public:
20942114
LocalMergeNode(
@@ -2195,6 +2215,8 @@ class LocalMergeNode : public PlanNode {
21952215
const std::vector<SortOrder> sortingOrders_;
21962216
};
21972217

2218+
using LocalMergeNodePtr = std::shared_ptr<const LocalMergeNode>;
2219+
21982220
/// Calculates partition number for each row of the specified vector.
21992221
class PartitionFunction {
22002222
public:
@@ -2418,6 +2440,8 @@ class LocalPartitionNode : public PlanNode {
24182440
const PartitionFunctionSpecPtr partitionFunctionSpec_;
24192441
};
24202442

2443+
using LocalPartitionNodePtr = std::shared_ptr<const LocalPartitionNode>;
2444+
24212445
class PartitionedOutputNode : public PlanNode {
24222446
public:
24232447
enum class Kind {
@@ -2647,6 +2671,8 @@ class PartitionedOutputNode : public PlanNode {
26472671
const RowTypePtr outputType_;
26482672
};
26492673

2674+
using PartitionedOutputNodePtr = std::shared_ptr<const PartitionedOutputNode>;
2675+
26502676
FOLLY_ALWAYS_INLINE std::ostream& operator<<(
26512677
std::ostream& out,
26522678
const PartitionedOutputNode::Kind kind) {
@@ -3062,6 +3088,8 @@ class HashJoinNode : public AbstractJoinNode {
30623088
const bool nullAware_;
30633089
};
30643090

3091+
using HashJoinNodePtr = std::shared_ptr<const HashJoinNode>;
3092+
30653093
/// Represents inner/outer/semi/anti merge joins. Translates to an
30663094
/// exec::MergeJoin operator. Assumes that both left and right input data is
30673095
/// sorted on the join keys. A separate pipeline that puts its output into
@@ -3132,6 +3160,8 @@ class MergeJoinNode : public AbstractJoinNode {
31323160
static PlanNodePtr create(const folly::dynamic& obj, void* context);
31333161
};
31343162

3163+
using MergeJoinNodePtr = std::shared_ptr<const MergeJoinNode>;
3164+
31353165
struct IndexLookupCondition : public ISerializable {
31363166
/// References to an index table column.
31373167
FieldAccessTypedExprPtr key;
@@ -3151,6 +3181,7 @@ struct IndexLookupCondition : public ISerializable {
31513181

31523182
virtual std::string toString() const = 0;
31533183
};
3184+
31543185
using IndexLookupConditionPtr = std::shared_ptr<IndexLookupCondition>;
31553186

31563187
/// Represents IN-LIST index lookup condition: contains('list', 'key'). 'list'
@@ -3178,6 +3209,7 @@ struct InIndexLookupCondition : public IndexLookupCondition {
31783209
private:
31793210
void validate() const;
31803211
};
3212+
31813213
using InIndexLookupConditionPtr = std::shared_ptr<InIndexLookupCondition>;
31823214

31833215
/// Represents BETWEEN index lookup condition: 'key' between 'lower' and
@@ -3213,6 +3245,7 @@ struct BetweenIndexLookupCondition : public IndexLookupCondition {
32133245
private:
32143246
void validate() const;
32153247
};
3248+
32163249
using BetweenIndexLookupConditionPtr =
32173250
std::shared_ptr<BetweenIndexLookupCondition>;
32183251

@@ -3376,6 +3409,8 @@ class IndexLookupJoinNode : public AbstractJoinNode {
33763409
const std::vector<IndexLookupConditionPtr> joinConditions_;
33773410
};
33783411

3412+
using IndexLookupJoinNodePtr = std::shared_ptr<const IndexLookupJoinNode>;
3413+
33793414
/// Returns true if 'planNode' is index lookup join node.
33803415
bool isIndexLookupJoin(const core::PlanNode* planNode);
33813416

@@ -3520,6 +3555,8 @@ class NestedLoopJoinNode : public PlanNode {
35203555
const RowTypePtr outputType_;
35213556
};
35223557

3558+
using NestedLoopJoinNodePtr = std::shared_ptr<const NestedLoopJoinNode>;
3559+
35233560
// Represents the 'SortBy' node in the plan.
35243561
class OrderByNode : public PlanNode {
35253562
public:
@@ -3661,6 +3698,8 @@ class OrderByNode : public PlanNode {
36613698
const std::vector<PlanNodePtr> sources_;
36623699
};
36633700

3701+
using OrderByNodePtr = std::shared_ptr<const OrderByNode>;
3702+
36643703
class TopNNode : public PlanNode {
36653704
public:
36663705
TopNNode(
@@ -3788,6 +3827,8 @@ class TopNNode : public PlanNode {
37883827
const std::vector<PlanNodePtr> sources_;
37893828
};
37903829

3830+
using TopNNodePtr = std::shared_ptr<const TopNNode>;
3831+
37913832
class LimitNode : public PlanNode {
37923833
public:
37933834
// @param isPartial Boolean indicating whether Limit node generates partial
@@ -3912,6 +3953,8 @@ class LimitNode : public PlanNode {
39123953
const std::vector<PlanNodePtr> sources_;
39133954
};
39143955

3956+
using LimitNodePtr = std::shared_ptr<const LimitNode>;
3957+
39153958
/// Expands arrays and maps into separate columns. Arrays are expanded into a
39163959
/// single column, and maps are expanded into two columns (key, value). Can be
39173960
/// used to expand multiple columns. In this case will produce as many rows as
@@ -4069,6 +4112,8 @@ class UnnestNode : public PlanNode {
40694112
RowTypePtr outputType_;
40704113
};
40714114

4115+
using UnnestNodePtr = std::shared_ptr<const UnnestNode>;
4116+
40724117
/// Checks that input contains at most one row. Return that row as is. If
40734118
/// input is empty, returns a single row with all values set to null. If input
40744119
/// contains more than one row raises an exception.
@@ -4138,6 +4183,8 @@ class EnforceSingleRowNode : public PlanNode {
41384183
const std::vector<PlanNodePtr> sources_;
41394184
};
41404185

4186+
using EnforceSingleRowNodePtr = std::shared_ptr<const EnforceSingleRowNode>;
4187+
41414188
/// Adds a new column named `idName` at the end of the input columns
41424189
/// with unique int64_t value per input row.
41434190
///
@@ -4244,6 +4291,8 @@ class AssignUniqueIdNode : public PlanNode {
42444291
std::shared_ptr<std::atomic_int64_t> uniqueIdCounter_;
42454292
};
42464293

4294+
using AssignUniqueIdNodePtr = std::shared_ptr<const AssignUniqueIdNode>;
4295+
42474296
/// PlanNode used for evaluating Sql window functions.
42484297
/// All window functions evaluated in the operator have the same
42494298
/// window spec (partition keys + order columns).
@@ -4491,6 +4540,8 @@ class WindowNode : public PlanNode {
44914540
const RowTypePtr outputType_;
44924541
};
44934542

4543+
using WindowNodePtr = std::shared_ptr<const WindowNode>;
4544+
44944545
/// Optimized version of a WindowNode for a single row_number function with an
44954546
/// optional limit and no sorting.
44964547
/// The output of this node contains all input columns followed by an optional
@@ -4625,6 +4676,8 @@ class RowNumberNode : public PlanNode {
46254676
const RowTypePtr outputType_;
46264677
};
46274678

4679+
using RowNumberNodePtr = std::shared_ptr<const RowNumberNode>;
4680+
46284681
/// The MarkDistinct operator marks unique rows based on distinctKeys.
46294682
/// The result is put in a new markerName column alongside the original input.
46304683
/// @param markerName Name of the output mask channel.
@@ -4735,6 +4788,8 @@ class MarkDistinctNode : public PlanNode {
47354788
const RowTypePtr outputType_;
47364789
};
47374790

4791+
using MarkDistinctNodePtr = std::shared_ptr<const MarkDistinctNode>;
4792+
47384793
/// Optimized version of a WindowNode for a single row_number function with a
47394794
/// limit over sorted partitions.
47404795
/// The output of this node contains all input columns followed by an optional
@@ -4913,6 +4968,8 @@ class TopNRowNumberNode : public PlanNode {
49134968
const RowTypePtr outputType_;
49144969
};
49154970

4971+
using TopNRowNumberNodePtr = std::shared_ptr<const TopNRowNumberNode>;
4972+
49164973
class PlanNodeVisitorContext {
49174974
public:
49184975
virtual ~PlanNodeVisitorContext() = default;

0 commit comments

Comments
 (0)