AEAggregate Class Reference

A class that models the GROUP BY list and the aggregate functions. More...

Inherits Simba::SQLEngine::AEUnaryRelationalExpr.

List of all members.

Public Member Functions

virtual void AcceptVisitor (AENodeVisitor &in_visitor)
 Calls the correct method on the visitor.
 AEAggregate (const AEAggregate &in_other)
 Copy constructor.
 AEAggregate (AutoPtr< AERelationalExpr > in_operand, AutoPtr< AEValueList > in_groupingList, const std::map< simba_size_t, simba_size_t > &in_groupingListOrdinalReferenceMap, AutoPtr< AEValueList > in_aggrList, AEQueryScope *in_queryScope)
 Constructor.
virtual AEAggregateClone () const
 Creates a clone of this node object.
const AEValueListGetAggregationList () const
 Get a reference to the aggregation list.
AEValueListGetAggregationList ()
 Get a reference to the aggregation list.
virtual const AEAggregateGetAsAggregate () const
 Retrieves the object as an AEAggregate object.
virtual AEAggregateGetAsAggregate ()
 Retrieves the object as an AEAggregate object.
virtual const AENodeGetChild (simba_size_t in_index) const
 Retrieves a pointer reference to the specified child node.
virtual AENodeGetChild (simba_size_t in_index)
 Retrieves a pointer reference to the specified child node.
virtual simba_size_t GetChildCount () const
 Retrieves the number of child nodes that this node has.
virtual Simba::DSI::IColumnGetColumn (simba_uint16 in_columnNum)
 Retrieves the column metadata for the given column.
virtual simba_uint16 GetColumnCount ()
 Returns the number of columns in this query operation.
const AEValueListGetGroupingList () const
 Retrieves a reference to the grouping list.
AEValueListGetGroupingList ()
 Retrieves a reference to the grouping list.
const std::map< simba_size_t,
simba_size_t > & 
GetGroupingListOrdinalReferenceMap () const
 Returns a reference to m_groupingListOrdinalReferenceMap.
virtual simba_wstring GetLogString () const
 Returns a string name for this node for the purpose of logging.
virtual AENodeType GetNodeType () const
 Returns an integer that uniquely identifies the node class.
AEQueryScope * GetQueryScope () const
 Retrieves the query scope that this group operation is from.
bool HasGroupingList () const
 Tells whether a grouping list is present.
virtual ~AEAggregate ()
 Destructor.

Detailed Description

A class that models the GROUP BY list and the aggregate functions.

For conceptual simplicity and for implementation convenience, an AGGREGATION is considered a unary relational expression. However, an AEAggregate node is deemed to have at most three child nodes: the relational operand, aggregation list, and the grouping list.

The grouping list may be NULL since an aggregation operation does not always require a GROUP BY clause (e.g. "select max(c1) from T1"). If the grouping list is present, it is always the first part of the aggregation list. For example, the following query,

"select C1, AVG(C3), MIN(C4) from T1 group by C1, C2"

has the grouping list "C1, C2" and the aggregation list "C1, C2, AVG(C3), MIN(C4)".

Will have two or three children (GetChildCount() returns 2 or 3). There will be three children only if a grouping list was supplied:


Constructor & Destructor Documentation

AEAggregate ( AutoPtr< AERelationalExpr in_operand,
AutoPtr< AEValueList in_groupingList,
const std::map< simba_size_t, simba_size_t > &  in_groupingListOrdinalReferenceMap,
AutoPtr< AEValueList in_aggrList,
AEQueryScope *  in_queryScope 
)

Constructor.

Parameters:
in_operand The operand for this relational expression.
in_groupingList The grouping list.
in_groupingListOrdinalReferenceMap See comments for m_groupingListOrdinalReferenceMap
in_aggrList The aggregation list.
in_queryScope The query scope that this node is from. Cannot be NULL. (NOT OWN)
AEAggregate ( const AEAggregate in_other  ) 

Copy constructor.

To support "cloning". See Clone() method.

Parameters:
in_other The other node to create copy from.
virtual ~AEAggregate (  )  [virtual]

Destructor.


Member Function Documentation

virtual void AcceptVisitor ( AENodeVisitor in_visitor  )  [virtual]

Calls the correct method on the visitor.

Parameters:
in_visitor The visiting object.

Implements AENode.

virtual AEAggregate* Clone (  )  const [virtual]

Creates a clone of this node object.

Returns:
A clone of this node object. (OWN)

Implements AEUnaryRelationalExpr.

const AEValueList* GetAggregationList (  )  const

Get a reference to the aggregation list.

Returns:
A pointer reference to the aggregation list. (NOT OWN)
AEValueList* GetAggregationList (  ) 

Get a reference to the aggregation list.

Returns:
A pointer reference to the aggregation list. (NOT OWN)
virtual const AEAggregate* GetAsAggregate (  )  const [virtual]

Retrieves the object as an AEAggregate object.

Overrides the method defined in AERelationalExpr.

Returns:
this object always. (NOT OWN)

Reimplemented from AERelationalExpr.

virtual AEAggregate* GetAsAggregate (  )  [virtual]

Retrieves the object as an AEAggregate object.

Overrides the method defined in AERelationalExpr.

Returns:
this object always. (NOT OWN)

Reimplemented from AERelationalExpr.

virtual const AENode* GetChild ( simba_size_t  in_index  )  const [virtual]

Retrieves a pointer reference to the specified child node.

Parameters:
in_index The zero-based index for the child.
Exceptions:
SEInvalidArgumentException when in_index is invalid.
Returns:
A pointer reference to the requested child node. (NOT OWN)

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual AENode* GetChild ( simba_size_t  in_index  )  [virtual]

Retrieves a pointer reference to the specified child node.

Parameters:
in_index The zero-based index for the child.
Exceptions:
SEInvalidArgumentException when in_index is invalid.
Returns:
A pointer reference to the requested child node. (NOT OWN)

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual simba_size_t GetChildCount (  )  const [virtual]

Retrieves the number of child nodes that this node has.

Returns:
The number of child nodes this node has.

Reimplemented from AEUnaryExprT< AERelationalExpr, AERelationalExpr >.

virtual Simba::DSI::IColumn* GetColumn ( simba_uint16  in_columnNum  )  [virtual]

Retrieves the column metadata for the given column.

Parameters:
in_columnNum A zero-based column index.
Exceptions:
SEInvalidArgumentException when the given column number is invalid
Returns:
the column metadata for the given column. (NOT OWN)

Implements AEQueryOperation.

virtual simba_uint16 GetColumnCount (  )  [virtual]

Returns the number of columns in this query operation.

Returns:
the number of columns that this relational expression has.

Implements AEQueryOperation.

const AEValueList* GetGroupingList (  )  const

Retrieves a reference to the grouping list.

Returns:
A pointer reference to the grouping list. (NOT OWN)
AEValueList* GetGroupingList (  ) 

Retrieves a reference to the grouping list.

Returns:
A pointer reference to the grouping list. (NOT OWN)
const std::map<simba_size_t, simba_size_t>& GetGroupingListOrdinalReferenceMap (  )  const

Returns a reference to m_groupingListOrdinalReferenceMap.

See comments for m_groupingListOrdinalReferenceMap for more information.

Returns:
A reference to m_groupingListOrdinalReferenceMap.
virtual simba_wstring GetLogString (  )  const [virtual]

Returns a string name for this node for the purpose of logging.

Returns:
A string representation of this node.

Implements AENode.

virtual AENodeType GetNodeType (  )  const [virtual]

Returns an integer that uniquely identifies the node class.

See the definition of AENodeType for values defined.

Returns:
The ID that uniquely identifies this type of nodes.

Implements AENode.

AEQueryScope* GetQueryScope (  )  const

Retrieves the query scope that this group operation is from.

USAGE NOTE: The returned pointer should only be used as an identifier only. Any attempt to access object will very likely result in a memory access violation failure.

Returns:
The query scope that this group operation is from. (NOT OWN)
bool HasGroupingList (  )  const

Tells whether a grouping list is present.

Returns:
true if the grouping list is present, false otherwise.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:16 2017 for SimbaEngine 10.1.3.1011 by simba