@Internal public final class FlinkCalciteSqlValidator extends SqlValidatorImpl
SqlValidator
by Flink-specific behavior.SqlValidatorImpl.DmlNamespace, SqlValidatorImpl.FunctionParamInfo, SqlValidatorImpl.IdInfo, SqlValidatorImpl.Status
callToOperandTypesMap, functionCallStack, idPositions, namespaces, scopes, TRACER, typeFactory, unknownType, UPDATE_ANON_PREFIX, UPDATE_SRC_ALIAS, UPDATE_TGT_ALIAS
Constructor and Description |
---|
FlinkCalciteSqlValidator(org.apache.calcite.sql.SqlOperatorTable opTab,
org.apache.calcite.sql.validate.SqlValidatorCatalogReader catalogReader,
org.apache.calcite.rel.type.RelDataTypeFactory typeFactory,
org.apache.calcite.sql.validate.SqlValidator.Config config,
org.apache.calcite.plan.RelOptTable.ToRelContext toRelcontext,
org.apache.calcite.plan.RelOptCluster relOptCluster,
org.apache.calcite.tools.FrameworkConfig frameworkConfig) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToSelectList(List<org.apache.calcite.sql.SqlNode> list,
Set<String> aliases,
List<Map.Entry<String,org.apache.calcite.rel.type.RelDataType>> fieldList,
org.apache.calcite.sql.SqlNode exp,
org.apache.calcite.sql.validate.SelectScope scope,
boolean includeSystemVars)
Adds an expression to a select list, ensuring that its alias does not clash with any existing
expressions on the list.
|
Optional<org.apache.calcite.rel.type.RelDataType> |
getExpectedOutputType(org.apache.calcite.sql.SqlNode sqlNode) |
protected @PolyNull org.apache.calcite.sql.SqlNode |
performUnconditionalRewrites(@PolyNull org.apache.calcite.sql.SqlNode node,
boolean underFrom)
Performs expression rewrites which are always used unconditionally.
|
protected void |
registerNamespace(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope usingScope,
@Nullable String alias,
org.apache.calcite.sql.validate.SqlValidatorNamespace ns,
boolean forceNullable)
Registers a new namespace, and adds it as a child of its parent scope.
|
void |
setExpectedOutputType(org.apache.calcite.sql.SqlNode sqlNode,
org.apache.calcite.rel.type.RelDataType expectedOutputType) |
void |
validateColumnListParams(org.apache.calcite.sql.SqlFunction function,
List<org.apache.calcite.rel.type.RelDataType> argTypes,
List<org.apache.calcite.sql.SqlNode> operands) |
protected void |
validateJoin(org.apache.calcite.sql.SqlJoin join,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateLiteral(org.apache.calcite.sql.SqlLiteral literal) |
checkTypeAssignment, config, createMatchRecognizeNameSpace, createPivotNameSpace, createSelectNamespace, createSetopNamespace, createSourceSelectForDelete, createSourceSelectForUpdate, createTargetRowType, createUnpivotNameSpace, declareCursor, deriveAlias, deriveConstructorType, deriveType, expand, expandGroupByOrHavingExpr, expandOrderExpr, expandSelectExpr, expandStar, getAggregate, getCatalogReader, getConformance, getCursorScope, getEmptyScope, getFieldOrigins, getFromScope, getGroupScope, getHavingScope, getJoinScope, getLogicalSourceRowType, getLogicalTargetRowType, getMatchRecognizeScope, getNamespace, getOperatorTable, getOrderScope, getOriginal, getOverScope, getParameterRowType, getParentCursor, getRawSelectScope, getSelectScope, getSelfJoinExprForUpdate, getTypeCoercion, getTypeFactory, getUnknownType, getValidatedNodeType, getValidatedNodeTypeIfKnown, getValidatedOperandTypes, getValidationErrorFunction, getWhereScope, getWindowByName, getWithScope, handleUnresolvedFunction, inferUnknownTypes, isAggregate, isAggregate, isNestedAggregateWindow, isOverAggregateWindow, isSystemField, lookupHints, lookupNameCompletionHints, lookupQualifiedName, makeNullaryCall, newValidationError, popFunctionCall, pushFunctionCall, removeValidatedNodeType, resolveWindow, setOriginal, setValidatedNodeType, shouldAllowIntermediateOrderBy, shouldAllowOverRelation, transform, usingNames, validate, validateAggregateParams, validateCall, validateDataType, validateDelete, validateDynamicParam, validateFeature, validateFrom, validateGroupClause, validateHavingClause, validateIdentifier, validateInsert, validateIntervalQualifier, validateMatchRecognize, validateMerge, validateModality, validateNamespace, validateOrderList, validateOver, validateParameterizedExpression, validatePivot, validateQuery, validateSelect, validateSelectList, validateSequenceValue, validateTableFunction, validateUnnest, validateUnpivot, validateUpdate, validateValues, validateWhereClause, validateWhereOrOn, validateWindow, validateWindowClause, validateWith, validateWithItem
public FlinkCalciteSqlValidator(org.apache.calcite.sql.SqlOperatorTable opTab, org.apache.calcite.sql.validate.SqlValidatorCatalogReader catalogReader, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, org.apache.calcite.sql.validate.SqlValidator.Config config, org.apache.calcite.plan.RelOptTable.ToRelContext toRelcontext, org.apache.calcite.plan.RelOptCluster relOptCluster, org.apache.calcite.tools.FrameworkConfig frameworkConfig)
public void setExpectedOutputType(org.apache.calcite.sql.SqlNode sqlNode, org.apache.calcite.rel.type.RelDataType expectedOutputType)
public Optional<org.apache.calcite.rel.type.RelDataType> getExpectedOutputType(org.apache.calcite.sql.SqlNode sqlNode)
public void validateLiteral(org.apache.calcite.sql.SqlLiteral literal)
validateLiteral
in interface org.apache.calcite.sql.validate.SqlValidator
validateLiteral
in class SqlValidatorImpl
protected void validateJoin(org.apache.calcite.sql.SqlJoin join, org.apache.calcite.sql.validate.SqlValidatorScope scope)
validateJoin
in class SqlValidatorImpl
public void validateColumnListParams(org.apache.calcite.sql.SqlFunction function, List<org.apache.calcite.rel.type.RelDataType> argTypes, List<org.apache.calcite.sql.SqlNode> operands)
validateColumnListParams
in interface org.apache.calcite.sql.validate.SqlValidator
validateColumnListParams
in class SqlValidatorImpl
protected void registerNamespace(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope usingScope, @Nullable String alias, org.apache.calcite.sql.validate.SqlValidatorNamespace ns, boolean forceNullable)
SqlValidatorImpl
registerNamespace
in class SqlValidatorImpl
usingScope
- Parent scope (which will want to look for things in this namespace)alias
- Alias by which parent will refer to this namespacens
- NamespaceforceNullable
- Whether to force the type of namespace to be nullableprotected void addToSelectList(List<org.apache.calcite.sql.SqlNode> list, Set<String> aliases, List<Map.Entry<String,org.apache.calcite.rel.type.RelDataType>> fieldList, org.apache.calcite.sql.SqlNode exp, org.apache.calcite.sql.validate.SelectScope scope, boolean includeSystemVars)
SqlValidatorImpl
addToSelectList
in class SqlValidatorImpl
protected @PolyNull org.apache.calcite.sql.SqlNode performUnconditionalRewrites(@PolyNull org.apache.calcite.sql.SqlNode node, boolean underFrom)
SqlValidatorImpl
Returns null if and only if the original expression is null.
performUnconditionalRewrites
in class SqlValidatorImpl
node
- expression to be rewrittenunderFrom
- whether node appears directly under a FROM clauseCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.