Methods
|
|
|
|
__call__
|
__call__ (
where=None,
join=(),
outer=(),
rename=(),
keep=(),
calc=(),
groupBy=(),
)
Return a new RV based on select/project/join operations as follows:
-
where
- specify a condition that all rows of the new RV must meet
(equivalent to the relational algebra
select operation).
-
join
- an iterable of RV's that will be inner-joined with this RV
(if no
where is supplied, this is a cartesian product.)
-
outer
- an iterable of RV's that will be outer-joined with this RV's
inner-joined portions.
-
keep
- a sequence of the names of the columns that should be kept in
the new RV. Supplying a non-empty value here is equivalent to the
relational algebra
project operation.
-
rename
- a sequence of
(oldName,newName) tuples specifying columns
to be renamed. The old columns are automatically "kept", so if you
mix rename and keep , you do not need to list renamed columns in the
keep argument.
-
calc
- a sequence of
(name,DV) pairs specifying computed columns
to include in the new RV. These columns are always added under the
given names, so keep and rename have no effect on the new columns.
-
groupBy
- a sequence of the names of the columns that the resulting
RV should be summarized on. These columns will be automatically
"kept", so if you mix
groupBy and keep , you do not need to list
group-by columns in the keep argument. Note that when using
groupBy , you should only keep or calculate columns that represent
aggregates, or else an error will occur.
|
|
__cmp__
|
__cmp__ ( other )
Relation variables must be comparable to each other
|
|
__getitem__
|
__getitem__ ( columnName )
Return the IRelationAttribute for the named column
|
|
__hash__
|
__hash__ ( other )
Relation variables must be hashable
|
|
attributes
|
attributes ()
Return a peak.util.Graph mapping names->relation attributes
|
|
clone
|
clone ()
Return a deepcopy()-like clone of the RV
|
|
getCondition
|
getCondition ()
Return any select() or join condition applying to this RV
|
|
getDB
|
getDB ()
Return an object indicating the responsible DB, or None if mixed
|
|
getInnerRVs
|
getInnerRVs ()
Return sequence of inner-join RV's, or (self,) if not a join
|
|
getOuterRVs
|
getOuterRVs ()
Return sequence of outer-join RV's, or () if not outer join
|
|
getReferencedRVs
|
getReferencedRVs ()
Return sequence of all RVs used in this RV (eg: joins,subqueries)
|
|
keys
|
keys ()
Return a sequence of column names
|