DSIExtAbstractProjectionHandler Class Reference

Defines an abstract class to facilitate the process of passing down of a relational PROJECTION operation. It supports:

More...

Inherits Simba::SQLEngine::IProjectionHandler.

List of all members.

Public Member Functions

virtual AutoPtr< AERelationalExprPassdown (AEProject *in_node)
 Pass down the given projection operation.
virtual ~DSIExtAbstractProjectionHandler ()
 Destructor.

Protected Member Functions

 DSIExtAbstractProjectionHandler ()
 Constructor.
virtual bool PassdownAdd (AEAdd *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual void PassdownColumn (AEColumn *in_node, const simba_wstring *in_name)=0
 Pass down the given column.
virtual bool PassdownCountStarAggrFunction (AECountStarAggrFunction *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownCustomScalarFn (AECustomScalarFn *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownDivide (AEDivide *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownIntervalLiteral (AEIntervalLiteral *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownLiteral (AELiteral *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownMultiply (AEMultiply *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownNegate (AENegate *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownNull (AENull *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownParameter (AEParameter *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownScalarFn (AEScalarFn *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownSearchedCase (AESearchedCase *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownSimpleCase (AESimpleCase *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownSubtract (AESubtract *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual bool PassdownValueSubQuery (AEValueSubQuery *in_node, const simba_wstring *in_name)
 Pass down the given value expression.
virtual SharedPtr
< DSIExtResultSet
TakeResult ()=0
 Get the result set representing the result of applying the operations successfully.

Friends

class DSIExtProjectValPassdownVisitor

Detailed Description

Defines an abstract class to facilitate the process of passing down of a relational PROJECTION operation. It supports:

If passing down the whole projection operation succeeds (all the project items are passed down), the engine will get the relational expression representing the result table of applying the passed down projection operation.

If passing down the whole projection operation fails (any of the project items cannot be passed down), the engine will go to visit sub-expressions in the projection items not being passed down and attempt to pass down column references. In this case, the engine will get a relational expression representing the updated project node after applying projection operation.

For example in the following query:

If the DSII is able to handle column references but not able to "ScalarFn()", Passdown() would return an updated AEProject node defined by the following project list and table:

Project list: C1, ScalarFn(C2 + C3) Project table: C1 | C2 | C3 --- |--- |--- | | | |

This design allows a "partial" projection operation to be handled.


Constructor & Destructor Documentation

virtual ~DSIExtAbstractProjectionHandler (  )  [virtual]

Destructor.

DSIExtAbstractProjectionHandler (  )  [protected]

Constructor.


Member Function Documentation

virtual AutoPtr<AERelationalExpr> Passdown ( AEProject in_node  )  [virtual]

Pass down the given projection operation.

This method allows for the DSII to fully or partially handle projection items and have the SQLEngine handle the rest if they are partially handled.

Parameters:
in_node The projection operation node. Cannot be NULL. (NOT OWN)
Returns:
The relational expression representing the result of applying the projection operation. If the projection operation is fully passed down, the result would be a result table that includes all the project items as its columns; NULL if the projection operation is partially passed down or passing down projection does not occur.

Implements IProjectionHandler.

virtual bool PassdownAdd ( AEAdd in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual void PassdownColumn ( AEColumn in_node,
const simba_wstring in_name 
) [protected, pure virtual]

Pass down the given column.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

NOTE: It is assumed that passing down a column is supported so this method _must_ succeed.

This method is pure virtual since PassdownColumn _must_ succeed. A sub-class wishing to support this value expression should implement this method.

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
virtual bool PassdownCountStarAggrFunction ( AECountStarAggrFunction in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownCustomScalarFn ( AECustomScalarFn in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownDivide ( AEDivide in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownIntervalLiteral ( AEIntervalLiteral in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownLiteral ( AELiteral in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownMultiply ( AEMultiply in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownNegate ( AENegate in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownNull ( AENull in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownParameter ( AEParameter in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownScalarFn ( AEScalarFn in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownSearchedCase ( AESearchedCase in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownSimpleCase ( AESimpleCase in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownSubtract ( AESubtract in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual bool PassdownValueSubQuery ( AEValueSubQuery in_node,
const simba_wstring in_name 
) [protected, virtual]

Pass down the given value expression.

NOTE: The passed down expression _must_ be named with the given name if the name is not NULL.

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

Parameters:
in_node The root of the value expression. Cannot be NULL. (NOT OWN)
in_name The name of the given expression as a column. (NOT OWN)
Returns:
True if the value expression is successfully passed down, false otherwise.
virtual SharedPtr<DSIExtResultSet> TakeResult (  )  [protected, pure virtual]

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

This method will be called in Passdown() after passing down all projection items of the AEProject node.

NOTE:

1) If the projection expression is fully passed down successfully, the result set returned _must_ have the projected items in the same order as the original projection list in the result table.

For example in the following query:

  • select C1, ScalarFn(C2 + C3), C4 + C5 from T1

If DSII can pass down each of projected items in projection list, the result set it returns should look like the following:

COLUMN | COLUMN | COLUMN C1 | ScalarFn(C2 + C3) | C4 + C5 ------ | ----------------- | ------- | | | |

2) If the projection operation is partially passed down, the result set returned from DSII would be a result table including: a) the projection items being passed down b) the columns involved in the projected items not being passed down

For example in the following query:

  • select C1, ScalarFn(C2 + C3), C4 + C5 from T1

If the DSII can handle the first item and the third item but cannot handle the second one, the result table it returns should look like the following:

COLUMN |COLUMN | COLUMN | COLUMN C1 | C2 | C3 | C4 + C5 ------ | ----- | ------ | ------ | | | | | |

The order of table columns is expected to be the same as the order of columns in project items.

3) If none of the projection component is passed down, return NULL.

Returns:
The result set representing the result of applying the operation successfully, NULL if the projection operation can _not_ be passed down at all.

Friends And Related Function Documentation

friend class DSIExtProjectValPassdownVisitor [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