DSIExtAbstractBooleanExprHandler Class Reference

An abstract class that facilitates the process of passing down filter and JOIN operations. More...

Inherits Simba::SQLEngine::IBooleanExprHandler.

Inherited by DSIExtSimpleBooleanExprHandler.

List of all members.

Public Member Functions

virtual bool CanHandleMoreClauses ()=0
 Ask whether the handler is able to handle more Passdown() calls.
virtual bool Passdown (AEBooleanExpr *in_node)
 Pass down the given Boolean expression that represents either a filter or a JOIN condition.
virtual SharedPtr
< DSIExtResultSet
TakeResult ()=0
 Get the result set representing the result of applying the operations successfully.
virtual ~DSIExtAbstractBooleanExprHandler ()
 Destructor.

Protected Member Functions

 DSIExtAbstractBooleanExprHandler ()
 Constructor.
virtual bool PassdownAnd (AEAnd *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownComparison (AEComparison *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownExistsPredicate (AEExistsPredicate *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownInPredicate (AEInPredicate *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownLikePredicate (AELikePredicate *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownNot (AENot *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownNullPredicate (AENullPredicate *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownOr (AEOr *in_node)
 Pass down the given Boolean expression representing a filter or join condition.
virtual bool PassdownQuantifiedComparison (AEQuantifiedComparison *in_node)
 Pass down the given Boolean expression representing a filter or join condition.

Friends

class Simba::SQLEngine::DSIExtBooleanExprPassdownVisitor

Detailed Description

An abstract class that facilitates the process of passing down filter and JOIN operations.

It implements the public Passdown(AEBooleanExpr*) method defined in the interface IBooleanExprHandler so that it calls the appropriate PassdownXXX() method defined in the protected scope of this class.

For the results created by passed-down joins, the function ResolveColumn() must be implemented. Before the pass down JOIN operation is finalized, all column references in the SQL statement need to be resolved so that they no longer reference the original tables. Instead, they reference this table.

For example in the following query:

After the JOIN operation is passed down, ResolveColumn() will be called on the returned table to resolve T1.C1 and T2.C2 in the SELECT_LIST.


Constructor & Destructor Documentation

virtual ~DSIExtAbstractBooleanExprHandler (  )  [virtual]

Destructor.

DSIExtAbstractBooleanExprHandler (  )  [protected]

Constructor.


Member Function Documentation

virtual bool CanHandleMoreClauses (  )  [pure virtual]

Ask whether the handler is able to handle more Passdown() calls.

After each Passdown() call, this method is called. It allows the handler to stop the Passdown process if the handler is able to make the decision upon observing certain Boolean expressions. Essentially, it gives the customer handler the ability to "short circuit" the pass down process.

For example, if a handler is used for passing down a JOIN operation and once the JOIN is handled, it will not allow any more JOIN conditions to be passed down. To avoid being asked by the SQL engine whether it can handle more clauses, the implementation for the JOIN handler could simply returns false after a JOIN condition is handled.

Returns:
True if the handler is able to handle more conditions, false otherwise.

Implements IBooleanExprHandler.

Implemented in DSIExtSimpleBooleanExprHandler.

virtual bool Passdown ( AEBooleanExpr in_node  )  [virtual]

Pass down the given Boolean expression that represents either a filter or a JOIN condition.

This method will be called at least once before TakeResult() will be called. TakeResult() will still be called even if Passdown() returns false to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression sub-tree. Cannot be NULL. (NOT OWN)
Returns:
True if the whole Boolean expression rooted at in_node is successfully passed down, false otherwise.

Implements IBooleanExprHandler.

virtual bool PassdownAnd ( AEAnd in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.
virtual bool PassdownComparison ( AEComparison in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.

Reimplemented in DSIExtSimpleBooleanExprHandler.

virtual bool PassdownExistsPredicate ( AEExistsPredicate in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.
virtual bool PassdownInPredicate ( AEInPredicate in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.

Reimplemented in DSIExtSimpleBooleanExprHandler.

virtual bool PassdownLikePredicate ( AELikePredicate in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.
virtual bool PassdownNot ( AENot in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.

Reimplemented in DSIExtSimpleBooleanExprHandler.

virtual bool PassdownNullPredicate ( AENullPredicate in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.

Reimplemented in DSIExtSimpleBooleanExprHandler.

virtual bool PassdownOr ( AEOr in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.
virtual bool PassdownQuantifiedComparison ( AEQuantifiedComparison in_node  )  [protected, virtual]

Pass down the given Boolean expression representing a filter or join condition.

This default implementation always return false. That is, the Boolean expression is not supported. A sub-class wishing to support this Boolean expression should override this method.

Note that TakeResult() will still be called, even if this function returns false, to allow for the DSII to partially handle filters and have the SQLEngine handle the rest.

Parameters:
in_node The root of the Boolean expression. Cannot be NULL. (NOT OWN)
Returns:
True if the Boolean expression is successfully passed down, false otherwise.
virtual SharedPtr<DSIExtResultSet> TakeResult (  )  [pure virtual]

Get the result set representing the result of applying the operations successfully.

NOTE:

1) Passdown() will be called at least once before this method will be called. Note that Passdown() can return false and TakeResult() will still be called, to allow the DSII to partially filter a result and have the SQLEngine complete the rest of the filtering.

2) The result set returned can be the same table used to create this IBooleanExprHandler object (

See also:
DSIExtOperationHandlerFactory::CreateFilterHandler()). If a new result set is returned, it _MUST_ have the same ordered list of columns as the original result set. The SQLEngine will update all columns that reference the original result set to point to the new result set.
Returns:
The result set representing the result of applying the operations on success, NULL if no filtering has occurred.

Implements IBooleanExprHandler.

Implemented in DSIExtSimpleBooleanExprHandler.


Friends And Related Function Documentation

friend class Simba::SQLEngine::DSIExtBooleanExprPassdownVisitor [friend]

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

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