AEJoin Class Reference

This class models the derived join relational operation: Join(R1, R2, Cond), where "Cond" is the join condition. More...

Inherits Simba::SQLEngine::AEBinaryRelationalExpr.

List of all members.

Public Member Functions

virtual void AcceptVisitor (AENodeVisitor &in_visitor)
 Calls the correct method on the visitor.
 AEJoin (const AEJoin &in_other)
 Copy constructor.
 AEJoin (AEJoinType in_joinType, AutoPtr< AERelationalExpr > in_leftOperand, AutoPtr< AERelationalExpr > in_rightOperand, AutoPtr< AEBooleanExpr > in_joinCond)
 Constructor.
 AEJoin (AEJoinType in_joinType, AutoPtr< AERelationalExpr > in_leftOperand, AutoPtr< AERelationalExpr > in_rightOperand)
 Constructor.
virtual AEJoinClone () const
 Creates a clone of this node object.
virtual void EvaluateUseCaching ()
 Evaluate if this node, or children nodes, should use caching.
virtual bool FindQColumn (const AEQColumnName &in_qColName, bool in_unquotedCaseSensitive, bool in_quotedCaseSensitive, AEColumnInfo &out_colInfo)
 Find the qualified column.
virtual const AEJoinGetAsJoin () const
 Retrieves the object as an AEJoin object.
virtual AEJoinGetAsJoin ()
 Retrieves the object as an AEJoin object.
virtual const AENodeGetChild (simba_size_t in_index) const
 Returns the specified child node.
virtual AENodeGetChild (simba_size_t in_index)
 Returns the specified child node.
virtual simba_size_t GetChildCount () const
 Returns the number of child nodes. In this case, it always returns 2.
virtual Simba::DSI::IColumnGetColumn (simba_uint16 in_columnNum)
 Gets the column metadata for the given column.
virtual simba_uint16 GetColumnCount ()
 Returns the number of columns in this query operation.
const AEBooleanExprGetJoinCond () const
 Returns the join condition as an AEBooleanExpr.
AEBooleanExprGetJoinCond ()
 Returns the join condition as an AEBooleanExpr.
AEJoinType GetJoinType () const
 Returns the Join type for this node.
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.
virtual void SetDataNeeded (simba_uint16 in_column, bool in_isNeeded)
 Indicates whether RetrieveData(...) might be called on the given column. This applies to any subsequent Move(...) calls.
void SetJoinCond (AutoPtr< AEBooleanExpr > in_cond)
 Grants the ownership of the join condition boolean expression to this object.
AutoPtr< AEBooleanExprTakeJoinCond ()
 Takes the ownership of the join condition boolean expression away from this object.
virtual void Validate ()
 Validates the node.
virtual ~AEJoin ()
 Destructor.

Detailed Description

This class models the derived join relational operation: Join(R1, R2, Cond), where "Cond" is the join condition.

This join is often known as Theta-Join in relational algebra. Although this relational operation is equivalent to sf(R1 R2), we chose to model this relation directly as it appears so often. The execution component can choose to implement this operation directly or in terms of select and cross join operations.

The following two semantically identical SQL queries can be translated to an AEJoin operation directly.

SELECT A.*, B.* FROM A,B WHERE cond

A JOIN B ON cond

The following two queries, however, cannot be translated to an AEJoin operation directly. They can be translated to a join following a project operation. That is, pa(A f B), where j represents the implicit joining condition: A.c1 = B.c1 AND A.c2 = B.c2 AND . That is, to translate such a join construct, the translator needs to first figure out the common columns in the two tables.

A JOIN B USING (common_column_list)

A NATURAL JOIN B

NOTE: The following joins are not currently supported by the parser,

NATURAL JOIN UNION JOIN

Will always have three children (GetChildCount() returns 3):


Constructor & Destructor Documentation

AEJoin ( AEJoinType  in_joinType,
AutoPtr< AERelationalExpr in_leftOperand,
AutoPtr< AERelationalExpr in_rightOperand 
)

Constructor.

NOTE: The join condition has to be set later.

Parameters:
in_joinType The Join type of this AEJoin node.
in_leftOperand The left operand.
in_rightOperand The right operand.
Exceptions:
SEInvalidArgumentException if the join type is invalid or one of the operands is NULL.
AEJoin ( AEJoinType  in_joinType,
AutoPtr< AERelationalExpr in_leftOperand,
AutoPtr< AERelationalExpr in_rightOperand,
AutoPtr< AEBooleanExpr in_joinCond 
)

Constructor.

Parameters:
in_joinType The Join type of this AEJoin node.
in_leftOperand The left operand.
in_rightOperand The right operand.
in_joinCond The join condition.
Exceptions:
SEInvalidArgumentException if the join type is invalid or one of the operands is NULL or the join condition is NULL.
AEJoin ( const AEJoin in_other  ) 

Copy constructor.

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

Parameters:
in_other The other node to create copy from.
virtual ~AEJoin (  )  [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 AEJoin* Clone (  )  const [virtual]

Creates a clone of this node object.

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

Implements AEBinaryRelationalExpr.

virtual void EvaluateUseCaching (  )  [virtual]

Evaluate if this node, or children nodes, should use caching.

Reimplemented from AERelationalExpr.

virtual bool FindQColumn ( const AEQColumnName in_qColName,
bool  in_unquotedCaseSensitive,
bool  in_quotedCaseSensitive,
AEColumnInfo out_colInfo 
) [virtual]

Find the qualified column.

Parameters:
in_qColName The qualified column name to find.
in_unquotedCaseSensitive True if unquoted column names are case sensitive; false otherwise.
in_quotedCaseSensitive Whether quoted columns should be case sensitive
out_colInfo The output column info if the column if found, untouched otherwise. Specifically, m_namedRelExpr and m_columnNum will be set if found. m_qsResolved and m_isOuterRef will _NOT_ be set.
Exceptions:
SEInvalidArgumentException when column name in in_qColName is empty.
SEInvalidOperationException if the operation does not apply on one of the operands.
Returns:
true if the qualified column is found, false otherwise.

Reimplemented from AERelationalExpr.

virtual const AEJoin* GetAsJoin (  )  const [virtual]

Retrieves the object as an AEJoin object.

Overrides the method defined in AERelationalExpr.

Returns:
This object as an AEJoin object. (NOT OWN)

Reimplemented from AERelationalExpr.

virtual AEJoin* GetAsJoin (  )  [virtual]

Retrieves the object as an AEJoin object.

Overrides the method defined in AERelationalExpr.

Returns:
This object as an AEJoin object. (NOT OWN)

Reimplemented from AERelationalExpr.

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

Returns the specified child node.

Child 0: Left operand. Child 1: Right operand. Child 2: Join condition.

The caller of this method does not own the returned child node.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

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 AEBinaryExprT< AERelationalExpr, AERelationalExpr >.

virtual AENode* GetChild ( simba_size_t  in_index  )  [virtual]

Returns the specified child node.

Child 0: Left operand. Child 1: Right operand. Child 2: Join condition.

The caller of this method does not own the returned child node.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

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 AEBinaryExprT< AERelationalExpr, AERelationalExpr >.

virtual simba_size_t GetChildCount (  )  const [virtual]

Returns the number of child nodes. In this case, it always returns 2.

This method is designed to override the method defined in BaseNodeT as seen in AENode.

Returns:
the number of child nodes.

Reimplemented from AEBinaryExprT< AERelationalExpr, AERelationalExpr >.

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

Gets the column metadata for the given column.

Parameters:
in_columnNum The zero-base 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.

Implements AEQueryOperation.

const AEBooleanExpr* GetJoinCond (  )  const

Returns the join condition as an AEBooleanExpr.

Returns:
A pointer reference to the join condition. (NOT OWN)
AEBooleanExpr* GetJoinCond (  ) 

Returns the join condition as an AEBooleanExpr.

Returns:
A pointer reference to the join condition. (NOT OWN)
AEJoinType GetJoinType (  )  const

Returns the Join type for this node.

Returns:
The Join type of this node.
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 for logging purposes.

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.

virtual void SetDataNeeded ( simba_uint16  in_column,
bool  in_isNeeded 
) [virtual]

Indicates whether RetrieveData(...) might be called on the given column. This applies to any subsequent Move(...) calls.

Parameters:
in_column A zero-based column index.
in_isNeeded Indicates whether data may be retrieved from the given column by the ODBC layer or not.
Exceptions:
SEInvalidArgumentException if in_column is invalid.

Implements AERelationalExpr.

void SetJoinCond ( AutoPtr< AEBooleanExpr in_cond  ) 

Grants the ownership of the join condition boolean expression to this object.

Parameters:
in_cond The join condition. (OWN)
Exceptions:
SEInvalidArgumentException when in_cond.IsNull() returns true.
AutoPtr<AEBooleanExpr> TakeJoinCond (  ) 

Takes the ownership of the join condition boolean expression away from this object.

Exceptions:
SEInvalidOperationException when m_joinCond.IsNull() returns true.
Returns:
The join condition. (OWN)
virtual void Validate (  )  [virtual]

Validates the node.

Exceptions:
AEInvalidAetException if the node is not valid.

Reimplemented from AENode.


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