@OperatorGeneratorCharacteristics(maximumArgumentCount=2, minimumArgumentCount=2, name="GROUP", signature={EXPRESSION,STRING}) @MonoRelationOperator public abstract class GROUP extends RelationalOperator
| Constructor and Description |
|---|
GROUP() |
| Modifier and Type | Method and Description |
|---|---|
static RelationBuffer |
computeGroup(RelationBuffer relationBuffer,
java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes,
java.util.Set<NameIdentifier> retainedAttributeNames) |
static Relation |
computeGroup(Relation relation,
java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes) |
static java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> |
getGroupSpec(java.lang.String groupSpecText)
Gets The group spec in the form of a mapping from NameIdentifiers to sets of them
|
OperatorImplementation_V0105 |
getOperatorImplementation(OperatorGeneratorArgument[] args)
Gets an implementation instance of the operator.
|
static GROUPInvocationResultDetails |
validateExpressionDetails(Heading heading,
java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes,
java.lang.String predicate,
java.util.Collection<? extends KeyDef> inputKeySpecifications) |
getInvocationName, getMaximumArgumentCount, getMinimumArgumentCount, getName, getOperatorGeneratorSignature, isMonoRelationOperator, toStringpublic static Relation computeGroup(Relation relation, java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes) throws EvaluationException
relation - the relation to be subjected to groupinggroupAttributes - The specification of the groupings to be applied. Each entry consists of an attribute name for the relation-valued attribute in the result, and the set of attributes of this relation that that relation-typed attribute is to include.EvaluationException - If the evaluation fails for any reasonpublic static RelationBuffer computeGroup(RelationBuffer relationBuffer, java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes, java.util.Set<NameIdentifier> retainedAttributeNames)
relationBuffer - the relation to be subjected to groupinggroupAttributes - The specification of the groupings to be applied. Each entry consists of an attribute name for the relation-valued attribute in the result, and the set of attributes of this relation that that relation-typed attribute is to include.retainedAttributeNames - The set of attributes to retain from the input expression, which is also the set of attributes to group bypublic static java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> getGroupSpec(java.lang.String groupSpecText) throws DuplicateNameException, NoClosingBracketException, InvalidEscapedCharacterException, MissingEscapedCharacterException, NoValueCorrespondingToNameException
groupSpecText - A sequence of g(l) specs where g is an attribute name and l is a comma-separated list of attribute names. Note that surrounding parentheses must have been removed.DuplicateNameException - If the String argument contains a duplicate name.NoClosingBracketException - If an opening bracket was found with an unmatched closing bracketInvalidEscapedCharacterException - If the string argument contains an invalid escape sequence, i.e. a backslash followed by a character other than ()\MissingEscapedCharacterException - If the string argument ends with the escape token (backslash), with the subsequent escaped character missingNoValueCorrespondingToNameException - If the string does not hold any opening bracket, meaning a name with no corresponding value is contained.public static GROUPInvocationResultDetails validateExpressionDetails(Heading heading, java.util.Map<NameIdentifier,java.util.Set<NameIdentifier>> groupAttributes, java.lang.String predicate, java.util.Collection<? extends KeyDef> inputKeySpecifications) throws NonExistingAttributeException, GroupAttributeOverlapException, AttributeGroupedTwiceException
heading - The heading of the relation that is subjected to groupinggroupAttributes - The specification of the groupings to be applied. Each entry consists of an attribute name for the relation-valued attribute in the result, and the set of attributes of this relation that that relation-typed attribute is to include.predicate - The predicate of which the input relation is the extensioninputKeySpecifications - The key specifications known to be satisfied by the input relationNonExistingAttributeException - If an attribute is specified for inclusion in an RVA that does not exist in the inputGroupAttributeOverlapException - If an attribute name is used for specifying an output RVA that also appears in the heading of the input. Note thatAttributeGroupedTwiceException - If an attribute is specified for inclusion in more than one RVApublic final OperatorImplementation_V0105 getOperatorImplementation(OperatorGeneratorArgument[] args) throws NotFoundException
OperatorGeneratorargs - The arguments from which the instance is to be created. There must be exactly as many arguments as there are elements in the list returned from OperatorGenerator.getOperatorGeneratorSignature(). The correspondence between OperatorGeneratorArgumentType values and OperatorGeneratorArgument types is given in the table below :
NotFoundException - If the given OperatorGeneratorArguments do not satisfy all of the rules of the OperatorGenerator. These rules are specific to each OperatorGenerator.