File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
optd-cost-model/src/common/predicates Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ use super::id_pred::IdPred;
77/// An [`AttributeRefPred`] has two children:
88/// 1. The table id, represented by an [`IdPred`].
99/// 2. The index of the column, represented by an [`IdPred`].
10+ ///
11+ /// Currently, [`AttributeRefPred`] only holds base table attributes, i.e. attributes
12+ /// that already exist in the table. More complex structures may be introduced in the
13+ /// future to represent derived attributes (e.g. t.v1 + t.v2).
1014#[ derive( Clone , Debug ) ]
1115pub struct AttributeRefPred ( pub ArcPredicateNode ) ;
1216
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ impl IdPred {
2323 . into ( ) ,
2424 )
2525 }
26+
27+ /// Gets the id stored in the predicate.
28+ pub fn id ( & self ) -> usize {
29+ self . 0 . data . clone ( ) . unwrap ( ) . as_u64 ( ) as usize
30+ }
2631}
2732
2833impl ReprPredicateNode for IdPred {
You can’t perform that action at this time.
0 commit comments