Package org.apache.calcite.test.catalog
Class VirtualColumnsExpressionFactory
java.lang.Object
org.apache.calcite.sql2rel.NullInitializerExpressionFactory
org.apache.calcite.test.catalog.VirtualColumnsExpressionFactory
- All Implemented Interfaces:
InitializerExpressionFactory
Define column strategies for the "VIRTUALCOLUMNS" table.
-
Field Summary
Fields inherited from class org.apache.calcite.sql2rel.NullInitializerExpressionFactory
INSTANCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerationStrategy
(RelOptTable table, int iColumn) Returns how a column is populated.newColumnDefaultValue
(RelOptTable table, int iColumn, InitializerContext context) Creates an expression which evaluates to the default value for a particular column.Methods inherited from class org.apache.calcite.sql2rel.NullInitializerExpressionFactory
isGeneratedAlways, newAttributeInitializer, postExpressionConversionHook
-
Constructor Details
-
VirtualColumnsExpressionFactory
public VirtualColumnsExpressionFactory()
-
-
Method Details
-
generationStrategy
Description copied from interface:InitializerExpressionFactory
Returns how a column is populated.- Specified by:
generationStrategy
in interfaceInitializerExpressionFactory
- Overrides:
generationStrategy
in classNullInitializerExpressionFactory
- Parameters:
table
- the table containing the columniColumn
- the 0-based offset of the column in the table- Returns:
- generation strategy, never null
- See Also:
-
newColumnDefaultValue
Description copied from interface:InitializerExpressionFactory
Creates an expression which evaluates to the default value for a particular column.If the default value comes from a un-validated
SqlNode
, make sure to invokeInitializerContext.validateExpression(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.sql.SqlNode)
first before you actually do the conversion with methodInitializerContext.convertExpression(org.apache.calcite.sql.SqlNode)
.- Specified by:
newColumnDefaultValue
in interfaceInitializerExpressionFactory
- Overrides:
newColumnDefaultValue
in classNullInitializerExpressionFactory
- Parameters:
table
- the table containing the columniColumn
- the 0-based offset of the column in the tablecontext
- Context for creating the expression- Returns:
- default value expression
-