Class SqlValidatorImpl
- All Implemented Interfaces:
org.apache.calcite.sql.validate.SqlValidator,org.apache.calcite.sql.validate.SqlValidatorWithHints
- Direct Known Subclasses:
FlinkCalciteSqlValidator,SqlValidatorWithSnapshot
SqlValidator, the class was copied over because of
CALCITE-4554.
Lines 200 ~ 203, Flink improves error message for functions without appropriate arguments in handleUnresolvedFunction.
Lines 2000 ~ 2020, Flink improves error message for functions without appropriate arguments in
handleUnresolvedFunction at handleUnresolvedFunction(org.apache.calcite.sql.SqlCall, org.apache.calcite.sql.SqlOperator, java.util.List<org.apache.calcite.rel.type.RelDataType>, java.util.List<java.lang.String>).
Lines 3814 ~ 3818, 6458 ~ 6464 Flink improves Optimize the retrieval of sub-operands in
SqlCall when using NamedParameters at checkRollUp(org.apache.calcite.sql.SqlNode, org.apache.calcite.sql.SqlNode, org.apache.calcite.sql.SqlNode, org.apache.calcite.sql.validate.SqlValidatorScope, java.lang.String).
Lines 5196 ~ 5209, Flink enables TIMESTAMP and TIMESTAMP_LTZ for system time period
specification type at validateSnapshot(org.apache.calcite.sql.SqlNode, org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.validate.SqlValidatorNamespace).
Lines 5553 ~ 5559, Flink enables TIMESTAMP and TIMESTAMP_LTZ for first orderBy column in
matchRecognize at validateMatchRecognize(org.apache.calcite.sql.SqlCall).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCommon base class for DML statement namespaces.protected static classUtility object used to maintain information about the parameters in a function call.protected static classInformation about an identifier in a particular scope.static enumValidation status.Nested classes/interfaces inherited from interface org.apache.calcite.sql.validate.SqlValidator
org.apache.calcite.sql.validate.SqlValidator.Config -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal IdentityHashMap<org.apache.calcite.sql.SqlCall,List<org.apache.calcite.rel.type.RelDataType>> Provides the data forgetValidatedOperandTypes(SqlCall).protected final Deque<SqlValidatorImpl.FunctionParamInfo>Stack of objects that maintain information about function calls.protected final Map<String,SqlValidatorImpl.IdInfo> MapsSqlParserPosstrings to theSqlIdentifieridentifier objects at these positions.protected final IdentityHashMap<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorNamespace> Maps anodeto thenamespacewhich describes what columns they contain.protected final IdentityHashMap<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorScope> Mapsquery nodeobjects to theSqlValidatorScopescope created from them.protected final org.apache.calcite.rel.type.TimeFrameSetstatic final org.slf4j.Loggerprotected final org.apache.calcite.rel.type.RelDataTypeFactoryprotected final org.apache.calcite.rel.type.RelDataTypestatic final StringAlias prefix generated for source columns when rewriting UPDATE to MERGE.static final StringAlias generated for the source table when rewriting UPDATE to MERGE.static final StringAlias generated for the target table when rewriting UPDATE to MERGE if no alias was specified by the user. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSqlValidatorImpl(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) Creates a validator. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToSelectList(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.protected voidcheckTypeAssignment(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope sourceScope, org.apache.calcite.sql.validate.SqlValidatorTable table, org.apache.calcite.rel.type.RelDataType sourceRowType, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.SqlNode query) Checks the type assignment of an INSERT or UPDATE query.org.apache.calcite.sql.validate.SqlValidator.Configconfig()protected org.apache.calcite.sql.validate.MatchRecognizeNamespacecreateMatchRecognizeNameSpace(org.apache.calcite.sql.SqlMatchRecognize call, org.apache.calcite.sql.SqlNode enclosingNode) protected org.apache.calcite.sql.validate.PivotNamespacecreatePivotNameSpace(org.apache.calcite.sql.SqlPivot call, org.apache.calcite.sql.SqlNode enclosingNode) protected org.apache.calcite.sql.validate.SelectNamespacecreateSelectNamespace(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.SqlNode enclosingNode) Creates a namespace for aSELECTnode.protected org.apache.calcite.sql.validate.SetopNamespacecreateSetopNamespace(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlNode enclosingNode) Creates a namespace for a set operation (UNION,INTERSECT, orEXCEPT).protected org.apache.calcite.sql.SqlSelectcreateSourceSelectForDelete(org.apache.calcite.sql.SqlDelete call) Creates the SELECT statement that putatively feeds rows into a DELETE statement to be deleted.protected org.apache.calcite.sql.SqlSelectcreateSourceSelectForUpdate(org.apache.calcite.sql.SqlUpdate call) Creates the SELECT statement that putatively feeds rows into an UPDATE statement to be updated.protected org.apache.calcite.rel.type.RelDataTypecreateTargetRowType(org.apache.calcite.sql.validate.SqlValidatorTable table, @Nullable org.apache.calcite.sql.SqlNodeList targetColumnList, boolean append) Derives a row-type for INSERT and UPDATE operations.protected org.apache.calcite.sql.validate.UnpivotNamespacecreateUnpivotNameSpace(org.apache.calcite.sql.SqlUnpivot call, org.apache.calcite.sql.SqlNode enclosingNode) voiddeclareCursor(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.validate.SqlValidatorScope parentScope) @Nullable StringderiveAlias(org.apache.calcite.sql.SqlNode node, int ordinal) org.apache.calcite.rel.type.RelDataTypederiveConstructorType(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlFunction unresolvedConstructor, @Nullable org.apache.calcite.sql.SqlFunction resolvedConstructor, List<org.apache.calcite.rel.type.RelDataType> argTypes) org.apache.calcite.rel.type.RelDataTypederiveType(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode expr) org.apache.calcite.sql.SqlNodeexpand(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SqlValidatorScope scope) org.apache.calcite.sql.SqlNodeexpandOrderExpr(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.SqlNode orderExpr) org.apache.calcite.sql.SqlNodeexpandSelectExpr(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SelectScope scope, org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.SqlNodeListexpandStar(org.apache.calcite.sql.SqlNodeList selectList, org.apache.calcite.sql.SqlSelect select, boolean includeSystemVars) org.apache.calcite.sql.SqlNodeextendedExpandGroupBy(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlSelect select) protected @Nullable org.apache.calcite.sql.SqlNodegetAggregate(org.apache.calcite.sql.SqlSelect select) Returns the parse tree node (GROUP BY, HAVING, or an aggregate function call) that causesselectto be an aggregate query, or null if it is not an aggregate query.org.apache.calcite.sql.validate.SqlValidatorCatalogReaderorg.apache.calcite.sql.validate.SqlConformanceorg.apache.calcite.sql.validate.SqlValidatorScopegetCursorScope(org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.validate.SqlValidatorScopegetFieldOrigins(org.apache.calcite.sql.SqlNode sqlQuery) @Nullable org.apache.calcite.sql.validate.SqlValidatorScopegetFromScope(org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.validate.SqlValidatorScopegetGroupScope(org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.validate.SqlValidatorScopegetHavingScope(org.apache.calcite.sql.SqlSelect select) @Nullable org.apache.calcite.sql.validate.SqlValidatorScopegetJoinScope(org.apache.calcite.sql.SqlNode node) protected org.apache.calcite.rel.type.RelDataTypegetLogicalSourceRowType(org.apache.calcite.rel.type.RelDataType sourceRowType, org.apache.calcite.sql.SqlInsert insert) protected org.apache.calcite.rel.type.RelDataTypegetLogicalTargetRowType(org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.SqlInsert insert) org.apache.calcite.sql.validate.SqlValidatorScopegetMatchRecognizeScope(org.apache.calcite.sql.SqlMatchRecognize node) @Nullable org.apache.calcite.sql.validate.SqlValidatorNamespacegetNamespace(org.apache.calcite.sql.SqlNode node) org.apache.calcite.sql.SqlOperatorTableorg.apache.calcite.sql.validate.SqlValidatorScopegetOrderScope(org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.SqlNodegetOriginal(org.apache.calcite.sql.SqlNode expr) org.apache.calcite.sql.validate.SqlValidatorScopegetOverScope(org.apache.calcite.sql.SqlNode node) org.apache.calcite.rel.type.RelDataTypegetParameterRowType(org.apache.calcite.sql.SqlNode sqlQuery) @Nullable StringgetParentCursor(String columnListParamName) @Nullable org.apache.calcite.sql.validate.SelectScopegetRawSelectScope(org.apache.calcite.sql.SqlSelect select) org.apache.calcite.sql.validate.SqlValidatorScopegetSelectScope(org.apache.calcite.sql.SqlSelect select) protected @Nullable org.apache.calcite.sql.SqlNodegetSelfJoinExprForUpdate(org.apache.calcite.sql.SqlNode table, String alias) Allows a subclass to provide information about how to convert an UPDATE into a MERGE via self-join.org.apache.calcite.rel.type.TimeFrameSetorg.apache.calcite.sql.validate.implicit.TypeCoercionorg.apache.calcite.rel.type.RelDataTypeFactoryorg.apache.calcite.rel.type.RelDataTypeorg.apache.calcite.rel.type.RelDataTypegetValidatedNodeType(org.apache.calcite.sql.SqlNode node) @Nullable org.apache.calcite.rel.type.RelDataTypegetValidatedNodeTypeIfKnown(org.apache.calcite.sql.SqlNode node) @Nullable List<org.apache.calcite.rel.type.RelDataType>getValidatedOperandTypes(org.apache.calcite.sql.SqlCall call) org.apache.calcite.sql.validate.SqlValidatorImpl.ValidationErrorFunctionorg.apache.calcite.sql.validate.SqlValidatorScopegetWhereScope(org.apache.calcite.sql.SqlSelect select) protected org.apache.calcite.sql.SqlWindowgetWindowByName(org.apache.calcite.sql.SqlIdentifier id, org.apache.calcite.sql.validate.SqlValidatorScope scope) @Nullable org.apache.calcite.sql.validate.SqlValidatorScopegetWithScope(org.apache.calcite.sql.SqlNode withItem) org.apache.calcite.runtime.CalciteExceptionhandleUnresolvedFunction(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlOperator unresolvedFunction, List<org.apache.calcite.rel.type.RelDataType> argTypes, @Nullable List<String> argNames) protected voidinferUnknownTypes(org.apache.calcite.rel.type.RelDataType inferredType, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode node) booleanisAggregate(org.apache.calcite.sql.SqlNode selectNode) Deprecated.booleanisAggregate(org.apache.calcite.sql.SqlSelect select) protected booleanisNestedAggregateWindow(org.apache.calcite.sql.SqlNode node) protected booleanisOverAggregateWindow(org.apache.calcite.sql.SqlNode node) booleanisSystemField(org.apache.calcite.rel.type.RelDataTypeField field) List<org.apache.calcite.sql.validate.SqlMoniker>lookupHints(org.apache.calcite.sql.SqlNode topNode, org.apache.calcite.sql.parser.SqlParserPos pos) final voidlookupNameCompletionHints(org.apache.calcite.sql.validate.SqlValidatorScope scope, List<String> names, org.apache.calcite.sql.parser.SqlParserPos pos, Collection<org.apache.calcite.sql.validate.SqlMoniker> hintList) Populates a list of all the valid alternatives for an identifier.@Nullable org.apache.calcite.sql.validate.SqlMonikerlookupQualifiedName(org.apache.calcite.sql.SqlNode topNode, org.apache.calcite.sql.parser.SqlParserPos pos) @Nullable org.apache.calcite.sql.SqlCallmakeNullaryCall(org.apache.calcite.sql.SqlIdentifier id) org.apache.calcite.runtime.CalciteContextExceptionnewValidationError(org.apache.calcite.sql.SqlNode node, org.apache.calcite.runtime.Resources.ExInst<org.apache.calcite.sql.validate.SqlValidatorException> e) protected @PolyNull org.apache.calcite.sql.SqlNodeperformUnconditionalRewrites(@PolyNull org.apache.calcite.sql.SqlNode node, boolean underFrom) Performs expression rewrites which are always used unconditionally.voidvoidprotected voidregisterNamespace(@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.voidremoveValidatedNodeType(org.apache.calcite.sql.SqlNode node) org.apache.calcite.sql.SqlLiteralresolveLiteral(org.apache.calcite.sql.SqlLiteral literal) org.apache.calcite.sql.SqlWindowresolveWindow(org.apache.calcite.sql.SqlNode windowOrRef, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidsetOriginal(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.SqlNode original) final voidsetValidatedNodeType(org.apache.calcite.sql.SqlNode node, org.apache.calcite.rel.type.RelDataType type) Saves the type of aSqlNode, now that it has been validated.protected booleanprotected booleanorg.apache.calcite.sql.validate.SqlValidatortransform(UnaryOperator<org.apache.calcite.sql.validate.SqlValidator.Config> transform) usingNames(org.apache.calcite.sql.SqlJoin join) Returns the set of field names in the join condition specified by USING or implicitly by NATURAL, de-duplicated and in order.org.apache.calcite.sql.SqlNodevalidate(org.apache.calcite.sql.SqlNode topNode) voidvalidateAggregateParams(org.apache.calcite.sql.SqlCall aggCall, @Nullable org.apache.calcite.sql.SqlNode filter, @Nullable org.apache.calcite.sql.SqlNodeList distinctList, @Nullable org.apache.calcite.sql.SqlNodeList orderList, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidvalidateCall(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidvalidateColumnListParams(org.apache.calcite.sql.SqlFunction function, List<org.apache.calcite.rel.type.RelDataType> argTypes, List<org.apache.calcite.sql.SqlNode> operands) voidvalidateDataType(org.apache.calcite.sql.SqlDataTypeSpec dataType) voidvalidateDelete(org.apache.calcite.sql.SqlDelete call) voidvalidateDynamicParam(org.apache.calcite.sql.SqlDynamicParam dynamicParam) protected voidvalidateFeature(org.apache.calcite.runtime.Feature feature, org.apache.calcite.sql.parser.SqlParserPos context) Validates that a particular feature is enabled.protected voidvalidateFrom(org.apache.calcite.sql.SqlNode node, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.validate.SqlValidatorScope scope) Validates the FROM clause of a query, or (recursively) a child node of the FROM clause: AS, OVER, JOIN, VALUES, or sub-query.protected voidvalidateGroupClause(org.apache.calcite.sql.SqlSelect select) Validates the GROUP BY clause of a SELECT statement.protected voidvalidateHavingClause(org.apache.calcite.sql.SqlSelect select) voidvalidateIdentifier(org.apache.calcite.sql.SqlIdentifier id, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidvalidateInsert(org.apache.calcite.sql.SqlInsert insert) voidvalidateIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier qualifier) protected voidvalidateJoin(org.apache.calcite.sql.SqlJoin join, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidvalidateLiteral(org.apache.calcite.sql.SqlLiteral literal) voidvalidateMatchRecognize(org.apache.calcite.sql.SqlCall call) voidvalidateMerge(org.apache.calcite.sql.SqlMerge call) booleanvalidateModality(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.validate.SqlModality modality, boolean fail) protected voidvalidateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace namespace, org.apache.calcite.rel.type.RelDataType targetRowType) Validates a namespace.protected voidvalidateOrderList(org.apache.calcite.sql.SqlSelect select) Validates the ORDER BY clause of a SELECT statement.protected voidvalidateOver(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope) org.apache.calcite.sql.SqlNodevalidateParameterizedExpression(org.apache.calcite.sql.SqlNode topNode, Map<String, org.apache.calcite.rel.type.RelDataType> nameToTypeMap) voidvalidatePivot(org.apache.calcite.sql.SqlPivot pivot) protected voidvalidateQualifyClause(org.apache.calcite.sql.SqlSelect select) voidvalidateQuery(org.apache.calcite.sql.SqlNode node, @Nullable org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) protected voidvalidateSelect(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.rel.type.RelDataType targetRowType) Validates a SELECT statement.protected org.apache.calcite.rel.type.RelDataTypevalidateSelectList(org.apache.calcite.sql.SqlNodeList selectItems, org.apache.calcite.sql.SqlSelect select, org.apache.calcite.rel.type.RelDataType targetRowType) voidvalidateSequenceValue(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlIdentifier id) protected voidvalidateTableFunction(org.apache.calcite.sql.SqlCall node, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) org.apache.calcite.rel.type.TimeFramevalidateTimeFrame(org.apache.calcite.sql.SqlIntervalQualifier qualifier) protected voidvalidateUnnest(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) voidvalidateUnpivot(org.apache.calcite.sql.SqlUnpivot unpivot) voidvalidateUpdate(org.apache.calcite.sql.SqlUpdate call) protected voidvalidateValues(org.apache.calcite.sql.SqlCall node, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.validate.SqlValidatorScope scope) Validates a VALUES clause.protected voidvalidateWhereClause(org.apache.calcite.sql.SqlSelect select) protected voidvalidateWhereOrOn(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode condition, String clause) voidvalidateWindow(org.apache.calcite.sql.SqlNode windowOrId, org.apache.calcite.sql.validate.SqlValidatorScope scope, @Nullable org.apache.calcite.sql.SqlCall call) protected voidvalidateWindowClause(org.apache.calcite.sql.SqlSelect select) voidvalidateWith(org.apache.calcite.sql.SqlWith with, org.apache.calcite.sql.validate.SqlValidatorScope scope) voidvalidateWithItem(org.apache.calcite.sql.SqlWithItem withItem) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlValidator
resolveWindow
-
Field Details
-
TRACER
public static final org.slf4j.Logger TRACER -
UPDATE_SRC_ALIAS
Alias generated for the source table when rewriting UPDATE to MERGE.- See Also:
-
UPDATE_TGT_ALIAS
Alias generated for the target table when rewriting UPDATE to MERGE if no alias was specified by the user.- See Also:
-
UPDATE_ANON_PREFIX
Alias prefix generated for source columns when rewriting UPDATE to MERGE.- See Also:
-
idPositions
MapsSqlParserPosstrings to theSqlIdentifieridentifier objects at these positions. -
scopes
protected final IdentityHashMap<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorScope> scopesMapsquery nodeobjects to theSqlValidatorScopescope created from them. -
namespaces
protected final IdentityHashMap<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorNamespace> namespacesMaps anodeto thenamespacewhich describes what columns they contain. -
functionCallStack
Stack of objects that maintain information about function calls. A stack is needed to handle nested function calls. The function call currently being validated is at the top of the stack. -
typeFactory
protected final org.apache.calcite.rel.type.RelDataTypeFactory typeFactory -
unknownType
protected final org.apache.calcite.rel.type.RelDataType unknownType -
timeFrameSet
protected final org.apache.calcite.rel.type.TimeFrameSet timeFrameSet -
callToOperandTypesMap
public final IdentityHashMap<org.apache.calcite.sql.SqlCall,List<org.apache.calcite.rel.type.RelDataType>> callToOperandTypesMapProvides the data forgetValidatedOperandTypes(SqlCall).
-
-
Constructor Details
-
SqlValidatorImpl
protected SqlValidatorImpl(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) Creates a validator.- Parameters:
opTab- Operator tablecatalogReader- Catalog readertypeFactory- Type factoryconfig- Config
-
-
Method Details
-
getConformance
public org.apache.calcite.sql.validate.SqlConformance getConformance() -
getCatalogReader
@Pure public org.apache.calcite.sql.validate.SqlValidatorCatalogReader getCatalogReader()- Specified by:
getCatalogReaderin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getOperatorTable
@Pure public org.apache.calcite.sql.SqlOperatorTable getOperatorTable()- Specified by:
getOperatorTablein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getTypeFactory
@Pure public org.apache.calcite.rel.type.RelDataTypeFactory getTypeFactory()- Specified by:
getTypeFactoryin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getUnknownType
public org.apache.calcite.rel.type.RelDataType getUnknownType()- Specified by:
getUnknownTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getTimeFrameSet
public org.apache.calcite.rel.type.TimeFrameSet getTimeFrameSet()- Specified by:
getTimeFrameSetin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
expandStar
public org.apache.calcite.sql.SqlNodeList expandStar(org.apache.calcite.sql.SqlNodeList selectList, org.apache.calcite.sql.SqlSelect select, boolean includeSystemVars) - Specified by:
expandStarin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
declareCursor
public void declareCursor(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.validate.SqlValidatorScope parentScope) - Specified by:
declareCursorin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
pushFunctionCall
public void pushFunctionCall()- Specified by:
pushFunctionCallin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
popFunctionCall
public void popFunctionCall()- Specified by:
popFunctionCallin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getParentCursor
- Specified by:
getParentCursorin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
usingNames
Returns the set of field names in the join condition specified by USING or implicitly by NATURAL, de-duplicated and in order. -
validate
public org.apache.calcite.sql.SqlNode validate(org.apache.calcite.sql.SqlNode topNode) - Specified by:
validatein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
lookupHints
public List<org.apache.calcite.sql.validate.SqlMoniker> lookupHints(org.apache.calcite.sql.SqlNode topNode, org.apache.calcite.sql.parser.SqlParserPos pos) - Specified by:
lookupHintsin interfaceorg.apache.calcite.sql.validate.SqlValidatorWithHints
-
lookupQualifiedName
public @Nullable org.apache.calcite.sql.validate.SqlMoniker lookupQualifiedName(org.apache.calcite.sql.SqlNode topNode, org.apache.calcite.sql.parser.SqlParserPos pos) - Specified by:
lookupQualifiedNamein interfaceorg.apache.calcite.sql.validate.SqlValidatorWithHints
-
lookupNameCompletionHints
public final void lookupNameCompletionHints(org.apache.calcite.sql.validate.SqlValidatorScope scope, List<String> names, org.apache.calcite.sql.parser.SqlParserPos pos, Collection<org.apache.calcite.sql.validate.SqlMoniker> hintList) Populates a list of all the valid alternatives for an identifier.- Parameters:
scope- Validation scopenames- Components of the identifierpos- positionhintList- a list of valid options
-
validateParameterizedExpression
public org.apache.calcite.sql.SqlNode validateParameterizedExpression(org.apache.calcite.sql.SqlNode topNode, Map<String, org.apache.calcite.rel.type.RelDataType> nameToTypeMap) - Specified by:
validateParameterizedExpressionin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateQuery
public void validateQuery(org.apache.calcite.sql.SqlNode node, @Nullable org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) - Specified by:
validateQueryin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateNamespace
protected void validateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace namespace, org.apache.calcite.rel.type.RelDataType targetRowType) Validates a namespace.- Parameters:
namespace- NamespacetargetRowType- Desired row type, must not be null, may be the data type 'unknown'.
-
getEmptyScope
public org.apache.calcite.sql.validate.SqlValidatorScope getEmptyScope() -
getCursorScope
public org.apache.calcite.sql.validate.SqlValidatorScope getCursorScope(org.apache.calcite.sql.SqlSelect select) -
getWhereScope
public org.apache.calcite.sql.validate.SqlValidatorScope getWhereScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getWhereScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getSelectScope
public org.apache.calcite.sql.validate.SqlValidatorScope getSelectScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getSelectScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getRawSelectScope
public @Nullable org.apache.calcite.sql.validate.SelectScope getRawSelectScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getRawSelectScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getHavingScope
public org.apache.calcite.sql.validate.SqlValidatorScope getHavingScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getHavingScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getGroupScope
public org.apache.calcite.sql.validate.SqlValidatorScope getGroupScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getGroupScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getFromScope
public @Nullable org.apache.calcite.sql.validate.SqlValidatorScope getFromScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getFromScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getOrderScope
public org.apache.calcite.sql.validate.SqlValidatorScope getOrderScope(org.apache.calcite.sql.SqlSelect select) - Specified by:
getOrderScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getMatchRecognizeScope
public org.apache.calcite.sql.validate.SqlValidatorScope getMatchRecognizeScope(org.apache.calcite.sql.SqlMatchRecognize node) - Specified by:
getMatchRecognizeScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getJoinScope
public @Nullable org.apache.calcite.sql.validate.SqlValidatorScope getJoinScope(org.apache.calcite.sql.SqlNode node) - Specified by:
getJoinScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getOverScope
public org.apache.calcite.sql.validate.SqlValidatorScope getOverScope(org.apache.calcite.sql.SqlNode node) - Specified by:
getOverScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getNamespace
public @Nullable org.apache.calcite.sql.validate.SqlValidatorNamespace getNamespace(org.apache.calcite.sql.SqlNode node) - Specified by:
getNamespacein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
performUnconditionalRewrites
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. These rewrites massage the expression tree into a standard form so that the rest of the validation logic can be simpler.Returns null if and only if the original expression is null.
- Parameters:
node- expression to be rewrittenunderFrom- whether node appears directly under a FROM clause- Returns:
- rewritten expression, or null if the original expression is null
-
getSelfJoinExprForUpdate
protected @Nullable org.apache.calcite.sql.SqlNode getSelfJoinExprForUpdate(org.apache.calcite.sql.SqlNode table, String alias) Allows a subclass to provide information about how to convert an UPDATE into a MERGE via self-join. If this method returns null, then no such conversion takes place. Otherwise, this method should return a suitable unique identifier expression for the given table.- Parameters:
table- identifier for table being updatedalias- alias to use for qualifying columns in expression, or null for unqualified references; if this is equal to "SYS$SRC", then column references have been anonymized to "SYS$ANONx", where x is the 1-based column number.- Returns:
- expression for unique identifier, or null to prevent conversion
-
createSourceSelectForUpdate
protected org.apache.calcite.sql.SqlSelect createSourceSelectForUpdate(org.apache.calcite.sql.SqlUpdate call) Creates the SELECT statement that putatively feeds rows into an UPDATE statement to be updated.- Parameters:
call- Call to the UPDATE operator- Returns:
- select statement
-
createSourceSelectForDelete
protected org.apache.calcite.sql.SqlSelect createSourceSelectForDelete(org.apache.calcite.sql.SqlDelete call) Creates the SELECT statement that putatively feeds rows into a DELETE statement to be deleted.- Parameters:
call- Call to the DELETE operator- Returns:
- select statement
-
getValidatedNodeType
public org.apache.calcite.rel.type.RelDataType getValidatedNodeType(org.apache.calcite.sql.SqlNode node) - Specified by:
getValidatedNodeTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getValidatedNodeTypeIfKnown
public @Nullable org.apache.calcite.rel.type.RelDataType getValidatedNodeTypeIfKnown(org.apache.calcite.sql.SqlNode node) - Specified by:
getValidatedNodeTypeIfKnownin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getValidatedOperandTypes
public @Nullable List<org.apache.calcite.rel.type.RelDataType> getValidatedOperandTypes(org.apache.calcite.sql.SqlCall call) - Specified by:
getValidatedOperandTypesin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
setValidatedNodeType
public final void setValidatedNodeType(org.apache.calcite.sql.SqlNode node, org.apache.calcite.rel.type.RelDataType type) Saves the type of aSqlNode, now that it has been validated.Unlike the base class method, this method is not deprecated. It is available from within Calcite, but is not part of the public API.
- Specified by:
setValidatedNodeTypein interfaceorg.apache.calcite.sql.validate.SqlValidator- Parameters:
node- A SQL parse tree node, never nulltype- Its type; must not be null
-
removeValidatedNodeType
public void removeValidatedNodeType(org.apache.calcite.sql.SqlNode node) - Specified by:
removeValidatedNodeTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
makeNullaryCall
public @Nullable org.apache.calcite.sql.SqlCall makeNullaryCall(org.apache.calcite.sql.SqlIdentifier id) - Specified by:
makeNullaryCallin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
deriveType
public org.apache.calcite.rel.type.RelDataType deriveType(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode expr) - Specified by:
deriveTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
deriveConstructorType
public org.apache.calcite.rel.type.RelDataType deriveConstructorType(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlFunction unresolvedConstructor, @Nullable org.apache.calcite.sql.SqlFunction resolvedConstructor, List<org.apache.calcite.rel.type.RelDataType> argTypes) - Specified by:
deriveConstructorTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
handleUnresolvedFunction
public org.apache.calcite.runtime.CalciteException handleUnresolvedFunction(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlOperator unresolvedFunction, List<org.apache.calcite.rel.type.RelDataType> argTypes, @Nullable List<String> argNames) - Specified by:
handleUnresolvedFunctionin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
inferUnknownTypes
protected void inferUnknownTypes(org.apache.calcite.rel.type.RelDataType inferredType, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode node) -
addToSelectList
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. -
deriveAlias
- Specified by:
deriveAliasin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
shouldAllowIntermediateOrderBy
protected boolean shouldAllowIntermediateOrderBy() -
createMatchRecognizeNameSpace
protected org.apache.calcite.sql.validate.MatchRecognizeNamespace createMatchRecognizeNameSpace(org.apache.calcite.sql.SqlMatchRecognize call, org.apache.calcite.sql.SqlNode enclosingNode) -
createPivotNameSpace
protected org.apache.calcite.sql.validate.PivotNamespace createPivotNameSpace(org.apache.calcite.sql.SqlPivot call, org.apache.calcite.sql.SqlNode enclosingNode) -
createUnpivotNameSpace
protected org.apache.calcite.sql.validate.UnpivotNamespace createUnpivotNameSpace(org.apache.calcite.sql.SqlUnpivot call, org.apache.calcite.sql.SqlNode enclosingNode) -
registerNamespace
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. Derived class can override this method to tinker with namespaces as they are created.- Parameters:
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 nullable
-
shouldAllowOverRelation
protected boolean shouldAllowOverRelation() -
createSelectNamespace
protected org.apache.calcite.sql.validate.SelectNamespace createSelectNamespace(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.SqlNode enclosingNode) Creates a namespace for aSELECTnode. Derived class may override this factory method.- Parameters:
select- Select nodeenclosingNode- Enclosing node- Returns:
- Select namespace
-
createSetopNamespace
protected org.apache.calcite.sql.validate.SetopNamespace createSetopNamespace(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.SqlNode enclosingNode) Creates a namespace for a set operation (UNION,INTERSECT, orEXCEPT). Derived class may override this factory method.- Parameters:
call- Call to set operationenclosingNode- Enclosing node- Returns:
- Set operation namespace
-
isAggregate
public boolean isAggregate(org.apache.calcite.sql.SqlSelect select) - Specified by:
isAggregatein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
isNestedAggregateWindow
protected boolean isNestedAggregateWindow(org.apache.calcite.sql.SqlNode node) -
isOverAggregateWindow
protected boolean isOverAggregateWindow(org.apache.calcite.sql.SqlNode node) -
getAggregate
protected @Nullable org.apache.calcite.sql.SqlNode getAggregate(org.apache.calcite.sql.SqlSelect select) Returns the parse tree node (GROUP BY, HAVING, or an aggregate function call) that causesselectto be an aggregate query, or null if it is not an aggregate query.The node is useful context for error messages, but you cannot assume that the node is the only aggregate function.
-
isAggregate
Deprecated.- Specified by:
isAggregatein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateIdentifier
public void validateIdentifier(org.apache.calcite.sql.SqlIdentifier id, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
validateIdentifierin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateLiteral
public void validateLiteral(org.apache.calcite.sql.SqlLiteral literal) - Specified by:
validateLiteralin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateIntervalQualifier
public void validateIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier qualifier) - Specified by:
validateIntervalQualifierin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateTimeFrame
public org.apache.calcite.rel.type.TimeFrame validateTimeFrame(org.apache.calcite.sql.SqlIntervalQualifier qualifier) - Specified by:
validateTimeFramein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateFrom
protected void validateFrom(org.apache.calcite.sql.SqlNode node, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.validate.SqlValidatorScope scope) Validates the FROM clause of a query, or (recursively) a child node of the FROM clause: AS, OVER, JOIN, VALUES, or sub-query.- Parameters:
node- Node in FROM clause, typically a table or derived tabletargetRowType- Desired row type of this expression, orunknownTypeif not fussy. Must not be null.scope- Scope
-
validateTableFunction
protected void validateTableFunction(org.apache.calcite.sql.SqlCall node, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) -
validateOver
protected void validateOver(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope) -
validateUnnest
protected void validateUnnest(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.rel.type.RelDataType targetRowType) -
validateJoin
protected void validateJoin(org.apache.calcite.sql.SqlJoin join, org.apache.calcite.sql.validate.SqlValidatorScope scope) -
validateSelect
protected void validateSelect(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.rel.type.RelDataType targetRowType) Validates a SELECT statement.- Parameters:
select- Select statementtargetRowType- Desired row type, must not be null, may be the data type 'unknown'.
-
validateModality
public boolean validateModality(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.validate.SqlModality modality, boolean fail) - Specified by:
validateModalityin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateWindowClause
protected void validateWindowClause(org.apache.calcite.sql.SqlSelect select) -
validateQualifyClause
protected void validateQualifyClause(org.apache.calcite.sql.SqlSelect select) -
validateWith
public void validateWith(org.apache.calcite.sql.SqlWith with, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
validateWithin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateWithItem
public void validateWithItem(org.apache.calcite.sql.SqlWithItem withItem) - Specified by:
validateWithItemin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateSequenceValue
public void validateSequenceValue(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlIdentifier id) - Specified by:
validateSequenceValuein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getWithScope
public @Nullable org.apache.calcite.sql.validate.SqlValidatorScope getWithScope(org.apache.calcite.sql.SqlNode withItem) - Specified by:
getWithScopein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getTypeCoercion
public org.apache.calcite.sql.validate.implicit.TypeCoercion getTypeCoercion()- Specified by:
getTypeCoercionin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
config
public org.apache.calcite.sql.validate.SqlValidator.Config config()- Specified by:
configin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
transform
public org.apache.calcite.sql.validate.SqlValidator transform(UnaryOperator<org.apache.calcite.sql.validate.SqlValidator.Config> transform) - Specified by:
transformin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateOrderList
protected void validateOrderList(org.apache.calcite.sql.SqlSelect select) Validates the ORDER BY clause of a SELECT statement.- Parameters:
select- Select statement
-
expandOrderExpr
public org.apache.calcite.sql.SqlNode expandOrderExpr(org.apache.calcite.sql.SqlSelect select, org.apache.calcite.sql.SqlNode orderExpr) - Specified by:
expandOrderExprin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateGroupClause
protected void validateGroupClause(org.apache.calcite.sql.SqlSelect select) Validates the GROUP BY clause of a SELECT statement. This method is called even if no GROUP BY clause is present. -
validateWhereClause
protected void validateWhereClause(org.apache.calcite.sql.SqlSelect select) -
validateWhereOrOn
protected void validateWhereOrOn(org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlNode condition, String clause) -
validateHavingClause
protected void validateHavingClause(org.apache.calcite.sql.SqlSelect select) -
validateSelectList
protected org.apache.calcite.rel.type.RelDataType validateSelectList(org.apache.calcite.sql.SqlNodeList selectItems, org.apache.calcite.sql.SqlSelect select, org.apache.calcite.rel.type.RelDataType targetRowType) -
createTargetRowType
protected org.apache.calcite.rel.type.RelDataType createTargetRowType(org.apache.calcite.sql.validate.SqlValidatorTable table, @Nullable org.apache.calcite.sql.SqlNodeList targetColumnList, boolean append) Derives a row-type for INSERT and UPDATE operations.- Parameters:
table- Target table for INSERT/UPDATEtargetColumnList- List of target columns, or null if not specifiedappend- Whether to append fields to those inbaseRowType- Returns:
- Rowtype
-
validateInsert
public void validateInsert(org.apache.calcite.sql.SqlInsert insert) - Specified by:
validateInsertin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getLogicalTargetRowType
protected org.apache.calcite.rel.type.RelDataType getLogicalTargetRowType(org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.SqlInsert insert) -
getLogicalSourceRowType
protected org.apache.calcite.rel.type.RelDataType getLogicalSourceRowType(org.apache.calcite.rel.type.RelDataType sourceRowType, org.apache.calcite.sql.SqlInsert insert) -
checkTypeAssignment
protected void checkTypeAssignment(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope sourceScope, org.apache.calcite.sql.validate.SqlValidatorTable table, org.apache.calcite.rel.type.RelDataType sourceRowType, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.SqlNode query) Checks the type assignment of an INSERT or UPDATE query.Skip the virtual columns(can not insert into) type assignment check if the source fields count equals with the real target table fields count, see how #checkFieldCount was used.
- Parameters:
sourceScope- Scope of query source which is used to infer node typetable- Target tablesourceRowType- Source row typetargetRowType- Target row type, it should either contain all the virtual columns (can not insert into) or exclude all the virtual columnsquery- The query
-
validateDelete
public void validateDelete(org.apache.calcite.sql.SqlDelete call) - Specified by:
validateDeletein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateUpdate
public void validateUpdate(org.apache.calcite.sql.SqlUpdate call) - Specified by:
validateUpdatein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateMerge
public void validateMerge(org.apache.calcite.sql.SqlMerge call) - Specified by:
validateMergein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateValues
protected void validateValues(org.apache.calcite.sql.SqlCall node, org.apache.calcite.rel.type.RelDataType targetRowType, org.apache.calcite.sql.validate.SqlValidatorScope scope) Validates a VALUES clause.- Parameters:
node- Values clausetargetRowType- Row type which expression must conform toscope- Scope within which clause occurs
-
validateDataType
public void validateDataType(org.apache.calcite.sql.SqlDataTypeSpec dataType) - Specified by:
validateDataTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateDynamicParam
public void validateDynamicParam(org.apache.calcite.sql.SqlDynamicParam dynamicParam) - Specified by:
validateDynamicParamin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getValidationErrorFunction
public org.apache.calcite.sql.validate.SqlValidatorImpl.ValidationErrorFunction getValidationErrorFunction() -
newValidationError
public org.apache.calcite.runtime.CalciteContextException newValidationError(org.apache.calcite.sql.SqlNode node, org.apache.calcite.runtime.Resources.ExInst<org.apache.calcite.sql.validate.SqlValidatorException> e) - Specified by:
newValidationErrorin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getWindowByName
protected org.apache.calcite.sql.SqlWindow getWindowByName(org.apache.calcite.sql.SqlIdentifier id, org.apache.calcite.sql.validate.SqlValidatorScope scope) -
resolveWindow
public org.apache.calcite.sql.SqlWindow resolveWindow(org.apache.calcite.sql.SqlNode windowOrRef, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
resolveWindowin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getOriginal
public org.apache.calcite.sql.SqlNode getOriginal(org.apache.calcite.sql.SqlNode expr) -
setOriginal
public void setOriginal(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.SqlNode original) -
validateWindow
public void validateWindow(org.apache.calcite.sql.SqlNode windowOrId, org.apache.calcite.sql.validate.SqlValidatorScope scope, @Nullable org.apache.calcite.sql.SqlCall call) - Specified by:
validateWindowin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateMatchRecognize
public void validateMatchRecognize(org.apache.calcite.sql.SqlCall call) - Specified by:
validateMatchRecognizein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validatePivot
public void validatePivot(org.apache.calcite.sql.SqlPivot pivot) -
validateUnpivot
public void validateUnpivot(org.apache.calcite.sql.SqlUnpivot unpivot) -
validateAggregateParams
public void validateAggregateParams(org.apache.calcite.sql.SqlCall aggCall, @Nullable org.apache.calcite.sql.SqlNode filter, @Nullable org.apache.calcite.sql.SqlNodeList distinctList, @Nullable org.apache.calcite.sql.SqlNodeList orderList, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
validateAggregateParamsin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateCall
public void validateCall(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
validateCallin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateFeature
protected void validateFeature(org.apache.calcite.runtime.Feature feature, org.apache.calcite.sql.parser.SqlParserPos context) Validates that a particular feature is enabled. By default, all features are enabled; subclasses may override this method to be more discriminating.- Parameters:
feature- feature being used, represented as a resource instancecontext- parser position context for error reporting, or null if
-
resolveLiteral
public org.apache.calcite.sql.SqlLiteral resolveLiteral(org.apache.calcite.sql.SqlLiteral literal) - Specified by:
resolveLiteralin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
expandSelectExpr
public org.apache.calcite.sql.SqlNode expandSelectExpr(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SelectScope scope, org.apache.calcite.sql.SqlSelect select) -
expand
public org.apache.calcite.sql.SqlNode expand(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SqlValidatorScope scope) - Specified by:
expandin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
extendedExpandGroupBy
public org.apache.calcite.sql.SqlNode extendedExpandGroupBy(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlSelect select) -
isSystemField
public boolean isSystemField(org.apache.calcite.rel.type.RelDataTypeField field) - Specified by:
isSystemFieldin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getFieldOrigins
- Specified by:
getFieldOriginsin interfaceorg.apache.calcite.sql.validate.SqlValidator
-
getParameterRowType
public org.apache.calcite.rel.type.RelDataType getParameterRowType(org.apache.calcite.sql.SqlNode sqlQuery) - Specified by:
getParameterRowTypein interfaceorg.apache.calcite.sql.validate.SqlValidator
-
validateColumnListParams
public void validateColumnListParams(org.apache.calcite.sql.SqlFunction function, List<org.apache.calcite.rel.type.RelDataType> argTypes, List<org.apache.calcite.sql.SqlNode> operands) - Specified by:
validateColumnListParamsin interfaceorg.apache.calcite.sql.validate.SqlValidator
-