ETMaterializerUtils Class Reference

A utility class for the ETMaterializer* classes. More...

List of all members.

Static Public Member Functions

static void AddConversionNode (const std::vector< SqlTypeMetadata * > &in_expectedMetadata, AERelationalExpr *in_aeRelationalExpr, AutoPtr< ETRelationalExpr > &io_etRelationalExpr, IWarningListener *in_warningListener)
 Creates a conversion node if needed for columns of the relational expression.
static void AddConversionNode (const SqlTypeMetadata &in_expectedMetadata, AERelationalExpr *in_aeRelationalExpr, AutoPtr< ETRelationalExpr > &io_etRelationalExpr, IWarningListener *in_warningListener)
 Creates a conversion node if needed for the first column of the relational expression.
static void AddConversionNode (AEValueExpr *in_aeValueExpr, const SqlTypeMetadata &in_expectedMetadata, SharedPtr< ETValueExpr > &io_etValueExpr, IWarningListener *in_warningListener)
 Creates a conversion node if needed.
static ETBooleanExprChainOrComparisons (ETMaterializer *in_materializer, AENode *in_valueList, SharedPtr< ETValueExpr > in_leftOperand, SqlTypeMetadata *in_metadata, const Simba::DSI::DSIColumnMetadata &in_columnMetadata)
 This function processes an AEValueList and creates a comparison node for each element in the value list, which is compared against in_leftOperand. If there are more than 1 expressions in the value list, this function chains the comparisons together using 1 or more ETOr nodes.
static AutoPtr< AEBooleanExprCloneBooleanExpr (AEBooleanExpr *in_booleanExpr)
 Creates a clone of the given boolean expression where column references still refer to the original tree (except for references to subqueries contained within the boolean expression, as those subqueries will be cloned as well.
static AutoPtr< AEValueExprCloneValueExpr (AEValueExpr *in_valueExpr)
 Creates a clone of the given value expression where column references still refer to the original tree (except for references to subqueries contained within the value expression, as those subqueries will be cloned as well.
static bool GetColumnOffset (AENode *in_node, ETRelationalExpr *in_oldColExpr, simba_uint16 &io_columnOffset)
 Gets the column offset in a join when replacing expressions.
static bool HasDirectLiteralChild (ETNode *in_operand)
 Determine if the given operand has a direct literal child.
static bool IsMetadataEqual (const SqlTypeMetadata &in_type1, const SqlTypeMetadata &in_type2)
 determine if two SqlTypeMetadata's are equal in terms of the SQL type, length, scale, and precision.
static ETValueList * MaterializeConvertedValueList (ETMaterializer *in_materializer, AEValueList *in_valueList, const std::vector< SqlTypeMetadata * > &in_expectedMetadata)
static void PushDownThroughProject (AEProject *in_projectionNode, IPushDownContainer *in_parentContainer, ETPushDownContainer &in_projectionContainer, AutoPtr< IPushDownSort > &out_modifiedSort)
 Helper to push down filters and sorts through a projection node.
static void PushDownThroughSubquery (ETMaterializer *in_materializer, AESubQuery *in_subQueryNode, IPushDownContainer *in_parentContainer, ETPushDownContainer &in_subQueryContainer, AutoVector< IPushDownFilter > &out_modifiedFilters)
 Helper to push down filters and sorts through a projection node.
static void SplitFilterForPushDown (AEBooleanExpr *in_filter, AutoVector< IPushDownFilter > &out_pushDownFilters)
 Split a filter into its conjuncts wrapped in a ETPushDownFilter in preparation for push-down.
static void UpdateColumnReferences (AENode &in_node, AENode *in_stopNode, AERelationalExpr &in_oldAERelExpr, ETRelationalExpr &in_newETRelExpr)
 Helper function to update column references.
static void UpdateProxyColRefs (AENode *in_node, ETRelationalExpr *in_etRelExpr, AEQueryScope *in_queryScope)
 Update all AEProxyColumn nodes in the given AE tree (in_node) so that they all point to the given ET relational expression node.
static void UpdateProxyColRefs (AENode *in_node, AERelationalExpr *in_aeRelExpr, AEQueryScope *in_queryScope)

Detailed Description

A utility class for the ETMaterializer* classes.


Member Function Documentation

static void AddConversionNode ( const std::vector< SqlTypeMetadata * > &  in_expectedMetadata,
AERelationalExpr in_aeRelationalExpr,
AutoPtr< ETRelationalExpr > &  io_etRelationalExpr,
IWarningListener in_warningListener 
) [static]

Creates a conversion node if needed for columns of the relational expression.

Parameters:
in_expectedMetadata The expected SQL type of the result columns. (NOT OWN)
in_aeRelationalExpr The AE relational expression node. (NOT OWN)
io_etRelationalExpr The ET relational expression node.
in_warningListener The warning listener to use for this node. (NOT OWN)
static void AddConversionNode ( const SqlTypeMetadata in_expectedMetadata,
AERelationalExpr in_aeRelationalExpr,
AutoPtr< ETRelationalExpr > &  io_etRelationalExpr,
IWarningListener in_warningListener 
) [static]

Creates a conversion node if needed for the first column of the relational expression.

Parameters:
in_expectedMetadata The expected SqlTypeMetadata of the result column.
in_aeRelationalExpr The AE relational expression node. (NOT OWN)
io_etRelationalExpr The ET relational expression node.
in_warningListener The warning listener to use for this node. (NOT OWN)
static void AddConversionNode ( AEValueExpr in_aeValueExpr,
const SqlTypeMetadata in_expectedMetadata,
SharedPtr< ETValueExpr > &  io_etValueExpr,
IWarningListener in_warningListener 
) [static]

Creates a conversion node if needed.

Parameters:
in_aeValueExpr The AE value expression node. (NOT OWN)
in_expectedMetadata The SqlTypeMetadata of the result.
io_etValueExpr The ET value expression node.
in_warningListener The warning listener to use for this node. (NOT OWN)
static ETBooleanExpr* ChainOrComparisons ( ETMaterializer in_materializer,
AENode in_valueList,
SharedPtr< ETValueExpr >  in_leftOperand,
SqlTypeMetadata in_metadata,
const Simba::DSI::DSIColumnMetadata in_columnMetadata 
) [static]

This function processes an AEValueList and creates a comparison node for each element in the value list, which is compared against in_leftOperand. If there are more than 1 expressions in the value list, this function chains the comparisons together using 1 or more ETOr nodes.

NOTE: in_valueList is declared as an AET_Node to prevent down-casting for the caller.

Parameters:
in_materializer A pointer reference to the materializer object to use to materializer ET nodes. (NOT OWN)
in_valueList A pointer reference to the AET_ValueList to process. (NOT OWN)
in_leftOperand The value expression that each expression in the value list should be compared against.
in_metadata The metadata for the results of each comparison. (NOT OWN)
in_columnMetadata The column metadata for each comparison.
Returns:
The top-most ETOr node. If there is only one value expression in the value list, then the sole comparison node, which compares the value expression against in_leftOperand is returned. (OWN)
static AutoPtr<AEBooleanExpr> CloneBooleanExpr ( AEBooleanExpr in_booleanExpr  )  [static]

Creates a clone of the given boolean expression where column references still refer to the original tree (except for references to subqueries contained within the boolean expression, as those subqueries will be cloned as well.

Parameters:
in_booleanExpr The boolean expression to clone. Cannot be NULL. (NOT OWN)
Returns:
The cloned boolean expression.
static AutoPtr<AEValueExpr> CloneValueExpr ( AEValueExpr in_valueExpr  )  [static]

Creates a clone of the given value expression where column references still refer to the original tree (except for references to subqueries contained within the value expression, as those subqueries will be cloned as well.

Parameters:
in_valueExpr The value expression to clone. Cannot be NULL. (NOT OWN)
Returns:
The cloned value expression.
static bool GetColumnOffset ( AENode in_node,
ETRelationalExpr in_oldColExpr,
simba_uint16 &  io_columnOffset 
) [static]

Gets the column offset in a join when replacing expressions.

This function recursively examines join operands to find the operand being replaced. During the examination, the column offset is calculated from left operand column counts and how many right operands are visited in order to find the expression.

Parameters:
in_node The node to examine. (NOT OWN)
in_oldColExpr The expression that is being replaced. (NOT OWN)
io_columnOffset The cumulative column offset.
Returns:
true if the expression was found, otherwise false.
static bool HasDirectLiteralChild ( ETNode in_operand  )  [inline, static]

Determine if the given operand has a direct literal child.

Parameters:
in_operand The root operand node to search. (NOT OWN)
Returns:
True if the was a direct literal child; false otherwise.
static bool IsMetadataEqual ( const SqlTypeMetadata in_type1,
const SqlTypeMetadata in_type2 
) [static]

determine if two SqlTypeMetadata's are equal in terms of the SQL type, length, scale, and precision.

Parameters:
in_type1 The first metadata to compare.
in_type2 The second metadata to compare.
Returns:
True if considered equal; false otherwise.
static ETValueList* MaterializeConvertedValueList ( ETMaterializer in_materializer,
AEValueList in_valueList,
const std::vector< SqlTypeMetadata * > &  in_expectedMetadata 
) [static]

This function materializes an AEValueList into an ETValueList, adding conversion nodes above nodes of the value list if the type is not the same as the expected type.

Parameters:
in_materializer A pointer reference to the materializer object to use to materializer ET nodes. (NOT OWN)
in_valueList A pointer reference to the AET_ValueList to process. (NOT OWN)
in_expectedMetadata The metadata for the results of each comparison. (NOT OWN)
Returns:
The materialized ETValueList with needed conversion nodes. (OWN)
static void PushDownThroughProject ( AEProject in_projectionNode,
IPushDownContainer *  in_parentContainer,
ETPushDownContainer &  in_projectionContainer,
AutoPtr< IPushDownSort > &  out_modifiedSort 
) [static]

Helper to push down filters and sorts through a projection node.

Parameters:
in_projectionNode The projection node to push down filters/sorts through. Cannot be NULL. (NOT OWN)
in_parentContainer The push down container coming from higher up the tree. (NOT OWN)
in_projectionContainer The projection node's push down container.
out_modifiedSort A container for an IPushDownSort which may be created by this function. It should not be used, only kept alive at least until in_projectionContainer is destroyed.
static void PushDownThroughSubquery ( ETMaterializer in_materializer,
AESubQuery in_subQueryNode,
IPushDownContainer *  in_parentContainer,
ETPushDownContainer &  in_subQueryContainer,
AutoVector< IPushDownFilter > &  out_modifiedFilters 
) [static]

Helper to push down filters and sorts through a projection node.

Parameters:
in_subQueryNode The subquery node to push down filters/sorts through. Cannot be NULL. (NOT OWN)
in_parentContainer The push down container coming from higher up the tree. (NOT OWN)
in_subQueryContainer The projection node's push down container.
out_modifiedFilters A container for any IPushDownFilters created by this function. These should not be used, only kept alive at least until in_subQueryContainer is destroyed.
static void SplitFilterForPushDown ( AEBooleanExpr in_filter,
AutoVector< IPushDownFilter > &  out_pushDownFilters 
) [static]

Split a filter into its conjuncts wrapped in a ETPushDownFilter in preparation for push-down.

Parameters:
in_filter The filter which will be pushed down. Cannot be NULL. (NOT OWN)
out_pushDownFilters The container to place the created IPushDownFilter*s.
static void UpdateColumnReferences ( AENode in_node,
AENode in_stopNode,
AERelationalExpr in_oldAERelExpr,
ETRelationalExpr in_newETRelExpr 
) [static]

Helper function to update column references.

Update the column references from their old relational expression to the new relational expression.

An example of usage is for ETIndexedResults. The column references point to the relational expression that is wrapped by the ETIndexedResult so the references must be updated because the source relational expression will be deleted after the initial scan.

This function will traverse recursively from the start node to the stop node. The stop node and its children will not be processed.

NOTE: The stop node can be NULL so that all nodes from the start node will be processed.

Parameters:
in_node The first node to update.
in_stopNode The node to stop updating. (NOT OWN)
in_oldAERelExpr The node for the old relational expression.
in_newETRelExpr The new relational expression.
static void UpdateProxyColRefs ( AENode in_node,
ETRelationalExpr in_etRelExpr,
AEQueryScope *  in_queryScope 
) [static]

Update all AEProxyColumn nodes in the given AE tree (in_node) so that they all point to the given ET relational expression node.

Parameters:
in_node The AE tree to be updated. Cannot be NULL. (NOT OWN)
in_etRelExpr The ET relational expression. Cannot be NULL. (NOT OWN)
in_queryScope The query scope belongs to. Cannot be NULL. (NOT OWN)
static void UpdateProxyColRefs ( AENode in_node,
AERelationalExpr in_aeRelExpr,
AEQueryScope *  in_queryScope 
) [static]

Update all AEProxyColumn nodes in the given AE tree (in_node) so that they all point to the given relational expression node.

Parameters:
in_node The AE tree to be updated. Cannot be NULL. (NOT OWN)
in_aeRelExpr The AE relational expression. Cannot be NULL. (NOT OWN)
in_queryScope The query scope belongs to. Cannot be NULL. (NOT OWN)

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

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