Package org.apache.calcite.sql2rel
Class NullInitializerExpressionFactory
- java.lang.Object
-
- org.apache.calcite.sql2rel.NullInitializerExpressionFactory
-
- All Implemented Interfaces:
InitializerExpressionFactory
- Direct Known Subclasses:
ModifiableViewTable.ModifiableViewTableInitializerExpressionFactory
public class NullInitializerExpressionFactory extends java.lang.Object implements InitializerExpressionFactory
An implementation ofInitializerExpressionFactory
that always supplies NULL.
-
-
Field Summary
Fields Modifier and Type Field Description static InitializerExpressionFactory
INSTANCE
-
Constructor Summary
Constructors Constructor Description NullInitializerExpressionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnStrategy
generationStrategy(RelOptTable table, int iColumn)
Returns how a column is populated.boolean
isGeneratedAlways(RelOptTable table, int iColumn)
Whether a column is always generated.RexNode
newAttributeInitializer(RelDataType type, SqlFunction constructor, int iAttribute, java.util.List<RexNode> constructorArgs, InitializerContext context)
Creates an expression which evaluates to the initializer expression for a particular attribute of a structured type.RexNode
newColumnDefaultValue(RelOptTable table, int iColumn, InitializerContext context)
Creates an expression which evaluates to the default value for a particular column.
-
-
-
Field Detail
-
INSTANCE
public static final InitializerExpressionFactory INSTANCE
-
-
Method Detail
-
isGeneratedAlways
public boolean isGeneratedAlways(RelOptTable table, int iColumn)
Description copied from interface:InitializerExpressionFactory
Whether a column is always generated. If a column is always generated, then non-generated values cannot be inserted into the column.- Specified by:
isGeneratedAlways
in interfaceInitializerExpressionFactory
- See Also:
InitializerExpressionFactory.generationStrategy(RelOptTable, int)
-
generationStrategy
public ColumnStrategy generationStrategy(RelOptTable table, int iColumn)
Description copied from interface:InitializerExpressionFactory
Returns how a column is populated.- Specified by:
generationStrategy
in interfaceInitializerExpressionFactory
- Parameters:
table
- the table containing the columniColumn
- the 0-based offset of the column in the table- Returns:
- generation strategy, never null
- See Also:
RelOptTable.getColumnStrategies()
-
newColumnDefaultValue
public RexNode newColumnDefaultValue(RelOptTable table, int iColumn, InitializerContext context)
Description copied from interface:InitializerExpressionFactory
Creates an expression which evaluates to the default value for a particular column.- Specified by:
newColumnDefaultValue
in interfaceInitializerExpressionFactory
- 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
-
newAttributeInitializer
public RexNode newAttributeInitializer(RelDataType type, SqlFunction constructor, int iAttribute, java.util.List<RexNode> constructorArgs, InitializerContext context)
Description copied from interface:InitializerExpressionFactory
Creates an expression which evaluates to the initializer expression for a particular attribute of a structured type.- Specified by:
newAttributeInitializer
in interfaceInitializerExpressionFactory
- Parameters:
type
- the structured typeconstructor
- the constructor invoked to initialize the typeiAttribute
- the 0-based offset of the attribute in the typeconstructorArgs
- arguments passed to the constructor invocationcontext
- Context for creating the expression- Returns:
- default value expression
-
-