ICoercionHandler Class Reference

ICoercionHandler provides a facility to implement custom coercion rules - either for standard SQL types or for custom data types. More...

Inherited by DSIExtCoercionHandler.

List of all members.

Public Member Functions

virtual SqlTypeMetadataCoerceComparisonType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion type rule for the comparison operators (<, <=, =, != or <>, >, >=).
virtual void CoerceDivideColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for the arithmetic divide operator.
virtual SqlTypeMetadataCoerceDivideType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the arithmetic divide operator.
virtual SqlTypeMetadataCoerceInType (const SqlTypeMetadata &in_left, const std::vector< SqlTypeMetadata * > &in_right, simba_uint32 in_leftColSize, const std::vector< simba_uint32 > &in_rightColSize)=0
 Implements the coercion rule for the IN comparison predicate operator.
virtual void CoerceLikeColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_patternMeta, const Simba::DSI::DSIColumnMetadata &in_matchMeta, const Simba::DSI::DSIColumnMetadata &in_escapeMeta, Simba::DSI::DSIColumnMetadata *io_resultMeta)=0
 Implements the coercion metadata rule for the LIKE comparison predicate operator.
virtual SqlTypeMetadataCoerceLikeType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the LIKE comparison predicate operator.
virtual void CoerceMinusColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for the arithmetic '-' operator.
virtual SqlTypeMetadataCoerceMinusType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the arithmetic '-' operator.
virtual void CoerceMultiplyColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for the arithmetic multiply operator.
virtual SqlTypeMetadataCoerceMultiplyType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the arithmetic multiply operator.
virtual void CoerceOtherColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for all other operators.
virtual SqlTypeMetadataCoerceOtherType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for all other operators.
virtual void CoercePlusColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for the arithmetic '+' operator.
virtual SqlTypeMetadataCoercePlusType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the arithmetic '+' operator.
virtual void CoerceUnionColumnMetadata (const Simba::DSI::DSIColumnMetadata &in_left, const Simba::DSI::DSIColumnMetadata &in_right, Simba::DSI::DSIColumnMetadata &io_resultMeta)=0
 Implements the coercion metadata rule for the union operator.
virtual SqlTypeMetadataCoerceUnionType (const SqlTypeMetadata &in_left, const SqlTypeMetadata &in_right, simba_uint32 in_leftColSize, simba_uint32 in_rightColSize)=0
 Implements the coercion rule for the union operator.
virtual ~ICoercionHandler ()
 Destructor.

Protected Member Functions

 ICoercionHandler ()
 Constructor.

Detailed Description

ICoercionHandler provides a facility to implement custom coercion rules - either for standard SQL types or for custom data types.

See DSIExtCoercionHandler for an implementation of this interface.

The DSII would sub-class from DSII DSIExtCoercionHandler, and override those functions for which it wishes to implement its own custom coercion rules.

Only Value Expression Operations need to coerce the column metadata. Boolean expression operations simply return a boolean (true or false) and thus do not need to coerce the column metadata.


Constructor & Destructor Documentation

virtual ~ICoercionHandler (  )  [inline, virtual]

Destructor.

ICoercionHandler (  )  [inline, protected]

Constructor.


Member Function Documentation

virtual SqlTypeMetadata* CoerceComparisonType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion type rule for the comparison operators (<, <=, =, != or <>, >, >=).

Boolean Expression Operations

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the comparison operators; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceDivideColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the arithmetic divide operator.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceDivideType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the arithmetic divide operator.

Value Expression Operations

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the arithmetic divide operator; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceInType ( const SqlTypeMetadata in_left,
const std::vector< SqlTypeMetadata * > &  in_right,
simba_uint32  in_leftColSize,
const std::vector< simba_uint32 > &  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the IN comparison predicate operator.

NOTE: The syntax for <in predicate> is:

<in predicate> ::= <row value constructor> [NOT] IN <in predicate value>

where <row value constructor> contains one or more value expressions. SimbaEngine SDK 8.0 currently supports one value expression for this <row value constructor>. The SqlTypeMetadata of the left operand is the type of this one value expression.

<in predicate value> is either a <table subquery> or a list of value expressions.

The value expressions in <in predicate value> do not necessarily need to be of the same type. Similarly, the columns in the <table subquery> do not necessarily need to be of the same type. This is why a vector of SqlTypeMetadata is passed for the right operand. It is up to the DSII how they wish to coerce the types in this vector.

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The vector of the SqlTypeMetadata for all the expressions in the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The vector of column sizes for each of the expressions in the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the IN comparison predicate operator; NULL if this coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceLikeColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_patternMeta,
const Simba::DSI::DSIColumnMetadata in_matchMeta,
const Simba::DSI::DSIColumnMetadata in_escapeMeta,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the LIKE comparison predicate operator.

Parameters:
in_patternMeta The DSIColumnMetadata of the pattern to match against.
in_matchMeta The DSIColumnMetadata of the column to match.
in_escapeMeta The DSIColumnMetadata of the escape character
io_resultMeta The DSIColumnMetadata of the coerced result of in_patternMeta and in_matchMeta. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceLikeType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the LIKE comparison predicate operator.

Parameters:
in_left The coerced SqlTypeMetadata for the left operand.
in_right The coerced SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the LIKE comparison predicate operator; NULL if this coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceMinusColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the arithmetic '-' operator.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceMinusType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the arithmetic '-' operator.

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the arithmetic '-' operator; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceMultiplyColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the arithmetic multiply operator.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceMultiplyType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the arithmetic multiply operator.

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the arithmetic multiply operator; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceOtherColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for all other operators.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceOtherType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for all other operators.

CoerceOther() would be used for scalar functions - REPLACE and CONCAT.

NOTE: For scalar functions that have more than 2 arguments (for example REPLACE has 3 arguments), SimbaEngine uses the following coercion process:

  • Coerce Argument 1 with Argument 2 -> CoercedResult1
  • Coerce CoercedResult1 with Argument 3 -> CoercedResult2
Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for all other operators; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoercePlusColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the arithmetic '+' operator.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoercePlusType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the arithmetic '+' operator.

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the arithmetic '+' operator; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.

virtual void CoerceUnionColumnMetadata ( const Simba::DSI::DSIColumnMetadata in_left,
const Simba::DSI::DSIColumnMetadata in_right,
Simba::DSI::DSIColumnMetadata io_resultMeta 
) [pure virtual]

Implements the coercion metadata rule for the union operator.

Parameters:
in_left The DSIColumnMetadata of the left operand.
in_right The DSIColumnMetadata of the right operand.
io_resultMeta The DSIColumnMetadata of the coerced result of in_left and in_right. This DSIColumnMetadata contains default coerced values as set by SimbaEngine. Override any or all of the values if the defaults are not suitable.

Implemented in DSIExtCoercionHandler.

virtual SqlTypeMetadata* CoerceUnionType ( const SqlTypeMetadata in_left,
const SqlTypeMetadata in_right,
simba_uint32  in_leftColSize,
simba_uint32  in_rightColSize 
) [pure virtual]

Implements the coercion rule for the union operator.

Parameters:
in_left The SqlTypeMetadata for the left operand.
in_right The SqlTypeMetadata for the right operand.
in_leftColSize The column size of the left operand.
in_rightColSize The column size of the right operand.

in_leftColSize and in_rightColSize can be ignored for fixed length data types. The column size should be considered when coercing variable length data types.

This default implementation returns NULL always.

Returns:
A new SqlTypeMetadata that represents the coercion of in_left and in_right for the arithmetic union operator; NULL if the coercion is not supported. (OWN)

Implemented in DSIExtCoercionHandler.


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