public abstract class TRANSFORM extends RelationalOperator
PROJECT
, EXTEND
and RENAME
as follows : Transform takes two arguments : the first being a relational expression, and the second a list of transform specs. So an invocation of TRANSFORM looks like TRANSFORM(<Relational Expression>,(<transform spec list>)). <transform spec list> is a list of attribute computation specifications, an attribute computation specification mentioning the attribute name for the relation produced, and an expression defining how to compute the value for a particular tuple in the result.
So a transform spec looks like <AttributeName>(<Expression>). The expression can be omitted, in which case it defaults to <AttributeName>. The resulting relation has all and exactly those attributes in its heading that are mentioned in the transform spec list. The value for each of those attributes is the value obtained by evaluating the expression corresponding to the attribute name in the transform spec list. TRANSFORM thus "bundles" the semantics of EXTEND, RENAME and PROJECT as follows :
Note that TRANSFORM is effectively implemented as the invocation of some projection of some extension of the input expression : TRANSFORM(R,...) === PROJECT(EXTEND(R,...),(...)), in which the first ellipsis stands for all <transform spec>s that include an expression, and the second for all attribute names mentioned in any <transform spec>. This implies that all the semantical rules of extend and project apply INDIVIDUALLY. In particular : this makes transform specs such as A(PLUS(A,A)) invalid because that would make an attribute named 'A' appear twice in the result of the extend. Note also that while A(B) is valid as a transform
spec (achieving the same result as RENAME if attribute B is not mentioned), the combination A(B)B(A) is invalid, while this same combination in an invocation of RENAME is valid (thereby achieving the result of the two attributes "swapping" values).Constructor and Description |
---|
TRANSFORM() |
Modifier and Type | Method and Description |
---|---|
int |
getMaximumArgumentCount()
Gets the maximum argument count for this operator.
|
int |
getMinimumArgumentCount()
Gets the minimum argument count for this operator.
|
java.lang.String |
getName()
Gets the operator name
|
boolean |
isMonoRelationOperator()
Checks if the operator takes only one Relation as input
|
toString
public final int getMaximumArgumentCount()
RelationalOperator
getMaximumArgumentCount
in class RelationalOperator
public final int getMinimumArgumentCount()
RelationalOperator
getMinimumArgumentCount
in class RelationalOperator
public final java.lang.String getName()
RelationalOperator
getName
in class RelationalOperator
public final boolean isMonoRelationOperator()
RelationalOperator
isMonoRelationOperator
in class RelationalOperator