In file expr.h:

class XxxValueExpression

Root class for the expression hierarchy

Inheritance:


Public Classes

enum ValExprTypeEnum
A list of all possible value types of value expressions

Public Fields

char* ExprName
Optional name for expression.

Public Methods

virtual int Arity ()
What is the arity?
inline XxxValueExpression* ChildExpr (int i)
Get the i'th subexpressions
virtual XxxValueExprList* DirectSubexpressions ()
Returns a list of the immediate subexpressions of the expression
virtual XxxADTMetaInfo* GenerateCatInfo ()
/ needed for expressions that generate complex data types
virtual XxxErrCode GetDependencies (XxxBitMap& Dependendency, int CorrelationHt)
Gets input stream dependencies (that were resolved in ResolveVars) Sets flags in the input argument Dependency
virtual XxxBool IsConstant ()
Is this a constant expression?
virtual XxxBool Match (const XxxValueExpression* OtherExpr, char *Env = NULL)
Checks to see if the expression matches another expression
virtual XxxBool Match (const XxxValueExpression* RuleExpr, XxxBindingEnv *BindEnv)
Checks if the expression matches another rule input expression If match is successful, return true, and assign BindTerm array inside XxxBindingEnv class
virtual XxxErrCode Optimize (XxxValueExprPlan*& ExecPlan)
Most expresions have hard coded execution strategies and so are automatically optimized
virtual void Print (ostream&)
Print the expression
virtual XxxBool ReferencesAggregate ()
Returns XXX_TRUE if this expression references an aggregate
virtual XxxErrCode Replace (const XxxUnknownValue *Target, const XxxValueExpression *Replacement)
Replaces all references to the target expression with references to the replacement expression
virtual XxxErrCode Replace (const XxxValueExpression *Target, const XxxValueExpression *Replacement)
Replaces all references to the target expression with references to the replacement expression
virtual XxxValueExpression* Replicate ()
Provides a convenient way to copy arbitrary expressions
virtual XxxErrCode ResolveVars (const XxxArgEnv* Env)
Tries to resolve host variables using the argument environment
virtual XxxErrCode ResolveVars (XxxQueryNode* Node, char Source)
Tries to resolve unknown variables using the child Source
virtual XxxErrCode ResolveVars (const XxxRecordSchema *Schema)
Tries to resolve unknown variables using a Schema
XxxErrCode SetChild (int Index, XxxValueExpression* NewExp)
Specify a particular subexpression (used in query rewrite)
virtual XxxErrCode TypeCheck ()
This should be called after all variables are resolved.
virtual XxxErrCode UpdateUnknowns (int ChildNumber, int OldAttrIndex, int NewAttrIndex, XxxBool &Appears)
Substitutes NewAttrIndex for OldAttrIndex in the SrcAttrIndex field of XxxUnknownValues subexpressions with SrcChild == ChildNumber Appears should be initialized with XXX_FALSE and is set to true if a column reference was found and updated
virtual XxxValueExprList* ValExprsReferenced ()
Returns a list of replications of all value expressions referenced in the expression
XxxValueExpression (const XxxValueExpression& src)
Copy constructor (used in most query rewrites)
XxxValueExpression (int NumChildren = 0, XxxValueExpression* Children[] = NULL)
Common constructor
virtual ~XxxValueExpression ()
Destructor

Public

typedef enum ValExprTypeEnum ValExprType
A typedef for easy reference
enum ValExprTypeEnum
A list of all possible value types of value expressions

Protected Fields

int arity
how many subexpressions?
XxxValueExpression** childExpr
array of subexpressions

Documentation

Root class for the expression hierarchy. Here's how the expression "library" works. The XxxExpression class provides a virtual base class for all kinds of expressions. It provides interfaces for type checking, etc. In the XXX system, every expression needs to be optimized. Therefore, there is a XxxValueExprPlan that is generated from an XxxExpression by invoking the Optimize() method. It is this XxxValueExprPlan that is executed in order to evaluate the expression.
int arity
how many subexpressions?

XxxValueExpression** childExpr
array of subexpressions

char* ExprName
Optional name for expression.

virtual XxxBool IsConstant()
Is this a constant expression?

virtual int Arity()
What is the arity?

inline XxxValueExpression* ChildExpr(int i)
Get the i'th subexpressions

virtual void Print(ostream&)
Print the expression

virtual XxxErrCode ResolveVars(const XxxRecordSchema *Schema)
Tries to resolve unknown variables using a Schema

virtual XxxErrCode ResolveVars(XxxQueryNode* Node, char Source)
Tries to resolve unknown variables using the child Source

virtual XxxErrCode ResolveVars(const XxxArgEnv* Env)
Tries to resolve host variables using the argument environment

virtual XxxErrCode TypeCheck()
This should be called after all variables are resolved.

virtual XxxErrCode Optimize(XxxValueExprPlan*& ExecPlan)
Most expresions have hard coded execution strategies and so are automatically optimized. Function expressions are not. Every expr must be Optimize()ed during query optimization!!

virtual XxxErrCode GetDependencies(XxxBitMap& Dependendency, int CorrelationHt)
Gets input stream dependencies (that were resolved in ResolveVars) Sets flags in the input argument Dependency. The size of the array is 1+ the actual number of input streams. The extra (0th) entry stands for the run-time ArgEnv

XxxErrCode SetChild(int Index, XxxValueExpression* NewExp)
Specify a particular subexpression (used in query rewrite)

virtual XxxBool Match(const XxxValueExpression* OtherExpr, char *Env = NULL)
Checks to see if the expression matches another expression

virtual XxxBool Match(const XxxValueExpression* RuleExpr, XxxBindingEnv *BindEnv)
Checks if the expression matches another rule input expression If match is successful, return true, and assign BindTerm array inside XxxBindingEnv class

virtual XxxValueExpression* Replicate()
Provides a convenient way to copy arbitrary expressions

virtual XxxErrCode Replace(const XxxValueExpression *Target, const XxxValueExpression *Replacement)
Replaces all references to the target expression with references to the replacement expression. Uses the match function to determine if the target expression is referenced. The replacement is replicated for all replacements.

virtual XxxErrCode Replace(const XxxUnknownValue *Target, const XxxValueExpression *Replacement)
Replaces all references to the target expression with references to the replacement expression. Used in XxxStrRules (Binquan)

virtual XxxErrCode UpdateUnknowns(int ChildNumber, int OldAttrIndex, int NewAttrIndex, XxxBool &Appears)
Substitutes NewAttrIndex for OldAttrIndex in the SrcAttrIndex field of XxxUnknownValues subexpressions with SrcChild == ChildNumber Appears should be initialized with XXX_FALSE and is set to true if a column reference was found and updated

virtual XxxBool ReferencesAggregate()
Returns XXX_TRUE if this expression references an aggregate

virtual XxxValueExprList* DirectSubexpressions()
Returns a list of the immediate subexpressions of the expression. The list consists of the children or the owner and arguments of an expression. Used in the AggregateFunctionPushDownRule. (mayr@cs)

virtual XxxValueExprList* ValExprsReferenced()
Returns a list of replications of all value expressions referenced in the expression. It is the caller's responsibility to destroy the list.

enum ValExprTypeEnum
A list of all possible value types of value expressions. These are used to identify subclass instances.

typedef enum ValExprTypeEnum ValExprType
A typedef for easy reference

virtual XxxADTMetaInfo* GenerateCatInfo()
/ needed for expressions that generate complex data types

XxxValueExpression(int NumChildren = 0, XxxValueExpression* Children[] = NULL)
Common constructor

XxxValueExpression(const XxxValueExpression& src)
Copy constructor (used in most query rewrites)

virtual ~XxxValueExpression()
Destructor


Direct child classes:
XxxUnknownValue
XxxFuncExpression
XxxConstValue
XxxCastValueExpression
XxxBooleanExpression
XxxArithExpression
XxxArgValue
Author:
Praveen

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de