com.lucidera.type
Class LucidDbTypeFactory
java.lang.Object
org.eigenbase.reltype.RelDataTypeFactoryImpl
org.eigenbase.sql.type.SqlTypeFactoryImpl
org.eigenbase.oj.OJTypeFactoryImpl
net.sf.farrago.type.FarragoTypeFactoryImpl
com.lucidera.type.LucidDbTypeFactory
- All Implemented Interfaces:
- FarragoTypeFactory, OJTypeFactory, RelDataTypeFactory
public class LucidDbTypeFactory
- extends FarragoTypeFactoryImpl
LucidDbTypeFactory overrides FarragoTypeFactoryImpl
with
LucidDB-specific type derivation rules.
- Version:
- $Id: //open/dev/farrago/src/com/lucidera/type/LucidDbTypeFactory.java#10 $
- Author:
- John Pham
Field Summary |
static int |
DECIMAL_PRODUCT_SCALE_CAP
Cap applied to the scale of a decimal multiplication product, if the
product's ideal precision is too high to be supported by LucidDb. |
static int |
DECIMAL_QUOTIENT_SCALE_CAP
Cap applied to the scale of a decimal division quotient. |
Methods inherited from class net.sf.farrago.type.FarragoTypeFactoryImpl |
createCwmElementType, createCwmType, createCwmTypeImpl, createJavaType, createJdbcColumnType, createJdbcColumnType, createJoinType, createMofType, createResultSetType, createResultSetType, createSqlType, createSqlType, createSqlType, createStructTypeFromClassifier, getClassForJavaParamStyle, getClassForPrimitive, getDefaultCharset, getRepos, getValueAccessExpression, toOJClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DECIMAL_PRODUCT_SCALE_CAP
public static final int DECIMAL_PRODUCT_SCALE_CAP
- Cap applied to the scale of a decimal multiplication product, if the
product's ideal precision is too high to be supported by LucidDb.
- See Also:
- Constant Field Values
DECIMAL_QUOTIENT_SCALE_CAP
public static final int DECIMAL_QUOTIENT_SCALE_CAP
- Cap applied to the scale of a decimal division quotient.
- See Also:
- Constant Field Values
LucidDbTypeFactory
public LucidDbTypeFactory(FarragoRepos repos)
createDecimalProduct
public RelDataType createDecimalProduct(RelDataType type1,
RelDataType type2)
- Similar to
RelDataTypeFactoryImpl.createDecimalProduct(org.eigenbase.reltype.RelDataType, org.eigenbase.reltype.RelDataType)
but caps
the maximum scale at DECIMAL_PRODUCT_SCALE_CAP
.
- Specified by:
createDecimalProduct
in interface RelDataTypeFactory
- Overrides:
createDecimalProduct
in class RelDataTypeFactoryImpl
- Parameters:
type1
- type of the first operandtype2
- type of the second operand
- Returns:
- the result type for a decimal multiplication, or null if decimal
multiplication should not be applied to the operands.
useDoubleMultiplication
public boolean useDoubleMultiplication(RelDataType type1,
RelDataType type2)
- Specified by:
useDoubleMultiplication
in interface RelDataTypeFactory
- Overrides:
useDoubleMultiplication
in class RelDataTypeFactoryImpl
- Returns:
- whether a decimal multiplication should be implemented by casting
arguments to double values.
createDecimalQuotient
public RelDataType createDecimalQuotient(RelDataType type1,
RelDataType type2)
- Similar to
RelDataTypeFactoryImpl.createDecimalQuotient(org.eigenbase.reltype.RelDataType, org.eigenbase.reltype.RelDataType)
but caps
the maximum scale at DECIMAL_QUOTIENT_SCALE_CAP
.
- Specified by:
createDecimalQuotient
in interface RelDataTypeFactory
- Overrides:
createDecimalQuotient
in class RelDataTypeFactoryImpl
- Parameters:
type1
- type of the first operandtype2
- type of the second operand
- Returns:
- the result type for a decimal division, or null if decimal
division should not be applied to the operands.
shouldRaggedFixedLengthValueUnionBeVariable
protected boolean shouldRaggedFixedLengthValueUnionBeVariable()
- Description copied from class:
SqlTypeFactoryImpl
- Controls behavior discussed here.
- Overrides:
shouldRaggedFixedLengthValueUnionBeVariable
in class SqlTypeFactoryImpl
- Returns:
- false (the default) to provide strict SQL:2003 behavior; true to
provide pragmatic behavior