public class SqlValidatorImpl extends Object implements org.apache.calcite.sql.validate.SqlValidatorWithHints
SqlValidator, the class was copied over because of
CALCITE-4554.
Lines 4697 ~ 4716, Flink enables TIMESTAMP and TIMESTAMP_LTZ for system time period specification type.
Lines 5034 ~ 5038, Flink enables TIMESTAMP and TIMESTAMP_LTZ for first orderBy column in matchRecognize.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SqlValidatorImpl.DmlNamespace
Common base class for DML statement namespaces.
|
protected static class |
SqlValidatorImpl.FunctionParamInfo
Utility object used to maintain information about the parameters in a function call.
|
protected static class |
SqlValidatorImpl.IdInfo
Information about an identifier in a particular scope.
|
static class |
SqlValidatorImpl.Status
Validation status.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected Deque<SqlValidatorImpl.FunctionParamInfo> |
functionCallStack
Stack of objects that maintain information about function calls.
|
protected Map<String,SqlValidatorImpl.IdInfo> |
idPositions
Maps
SqlParserPos strings to the SqlIdentifier identifier objects at these
positions. |
protected Map<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorNamespace> |
namespaces
Maps a
node to the namespace which describes
what columns they contain. |
protected Map<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorScope> |
scopes
Maps
query node objects to the SqlValidatorScope scope created from
them. |
static org.slf4j.Logger |
TRACER |
protected org.apache.calcite.rel.type.RelDataTypeFactory |
typeFactory |
protected org.apache.calcite.rel.type.RelDataType |
unknownType
The type of dynamic parameters until a type is imposed on them.
|
static String |
UPDATE_ANON_PREFIX
Alias prefix generated for source columns when rewriting UPDATE to MERGE.
|
static String |
UPDATE_SRC_ALIAS
Alias generated for the source table when rewriting UPDATE to MERGE.
|
static String |
UPDATE_TGT_ALIAS
Alias generated for the target table when rewriting UPDATE to MERGE if no alias was specified
by the user.
|
| 限定符 | 构造器和说明 |
|---|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
protected void |
checkTypeAssignment(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.Config |
config() |
protected org.apache.calcite.sql.validate.MatchRecognizeNamespace |
createMatchRecognizeNameSpace(SqlMatchRecognize call,
org.apache.calcite.sql.SqlNode enclosingNode) |
protected org.apache.calcite.sql.validate.PivotNamespace |
createPivotNameSpace(org.apache.calcite.sql.SqlPivot call,
org.apache.calcite.sql.SqlNode enclosingNode) |
protected org.apache.calcite.sql.validate.SelectNamespace |
createSelectNamespace(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.SqlNode enclosingNode)
Creates a namespace for a
SELECT node. |
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, or EXCEPT). |
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.
|
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.
|
protected org.apache.calcite.rel.type.RelDataType |
createTargetRowType(org.apache.calcite.sql.validate.SqlValidatorTable table,
org.apache.calcite.sql.SqlNodeList targetColumnList,
boolean append)
Derives a row-type for INSERT and UPDATE operations.
|
void |
declareCursor(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.validate.SqlValidatorScope parentScope) |
String |
deriveAlias(org.apache.calcite.sql.SqlNode node,
int ordinal) |
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,
org.apache.calcite.sql.SqlFunction resolvedConstructor,
List<org.apache.calcite.rel.type.RelDataType> argTypes) |
org.apache.calcite.rel.type.RelDataType |
deriveType(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlNode expr) |
org.apache.calcite.sql.SqlNode |
expand(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
org.apache.calcite.sql.SqlNode |
expandGroupByOrHavingExpr(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlSelect select,
boolean havingExpression) |
org.apache.calcite.sql.SqlNode |
expandOrderExpr(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.SqlNode orderExpr) |
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) |
org.apache.calcite.sql.SqlNodeList |
expandStar(org.apache.calcite.sql.SqlNodeList selectList,
org.apache.calcite.sql.SqlSelect select,
boolean includeSystemVars) |
protected 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 causes
select to be an aggregate query, or null if it is not an aggregate query. |
org.apache.calcite.sql.validate.SqlValidatorCatalogReader |
getCatalogReader() |
org.apache.calcite.sql.validate.SqlConformance |
getConformance() |
org.apache.calcite.sql.validate.SqlValidatorScope |
getCursorScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getEmptyScope() |
List<List<String>> |
getFieldOrigins(org.apache.calcite.sql.SqlNode sqlQuery) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getFromScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getGroupScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getHavingScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getJoinScope(org.apache.calcite.sql.SqlNode node) |
protected org.apache.calcite.rel.type.RelDataType |
getLogicalSourceRowType(org.apache.calcite.rel.type.RelDataType sourceRowType,
org.apache.calcite.sql.SqlInsert insert) |
protected org.apache.calcite.rel.type.RelDataType |
getLogicalTargetRowType(org.apache.calcite.rel.type.RelDataType targetRowType,
org.apache.calcite.sql.SqlInsert insert) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getMatchRecognizeScope(SqlMatchRecognize node) |
org.apache.calcite.sql.validate.SqlValidatorNamespace |
getNamespace(org.apache.calcite.sql.SqlNode node) |
org.apache.calcite.sql.SqlOperatorTable |
getOperatorTable() |
org.apache.calcite.sql.validate.SqlValidatorScope |
getOrderScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.SqlNode |
getOriginal(org.apache.calcite.sql.SqlNode expr) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getOverScope(org.apache.calcite.sql.SqlNode node) |
org.apache.calcite.rel.type.RelDataType |
getParameterRowType(org.apache.calcite.sql.SqlNode sqlQuery) |
String |
getParentCursor(String columnListParamName) |
org.apache.calcite.sql.validate.SelectScope |
getRawSelectScope(org.apache.calcite.sql.SqlSelect select) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getSelectScope(org.apache.calcite.sql.SqlSelect select) |
protected 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.
|
org.apache.calcite.sql.validate.implicit.TypeCoercion |
getTypeCoercion() |
org.apache.calcite.rel.type.RelDataTypeFactory |
getTypeFactory() |
org.apache.calcite.rel.type.RelDataType |
getUnknownType() |
org.apache.calcite.rel.type.RelDataType |
getValidatedNodeType(org.apache.calcite.sql.SqlNode node) |
org.apache.calcite.rel.type.RelDataType |
getValidatedNodeTypeIfKnown(org.apache.calcite.sql.SqlNode node) |
org.apache.calcite.sql.validate.SqlValidatorImpl.ValidationErrorFunction |
getValidationErrorFunction() |
org.apache.calcite.sql.validate.SqlValidatorScope |
getWhereScope(org.apache.calcite.sql.SqlSelect select) |
protected org.apache.calcite.sql.SqlWindow |
getWindowByName(org.apache.calcite.sql.SqlIdentifier id,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
org.apache.calcite.sql.validate.SqlValidatorScope |
getWithScope(org.apache.calcite.sql.SqlNode withItem) |
org.apache.calcite.runtime.CalciteException |
handleUnresolvedFunction(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.SqlFunction unresolvedFunction,
List<org.apache.calcite.rel.type.RelDataType> argTypes,
List<String> argNames) |
protected void |
inferUnknownTypes(org.apache.calcite.rel.type.RelDataType inferredType,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlNode node) |
boolean |
isAggregate(org.apache.calcite.sql.SqlNode selectNode)
已过时。
|
boolean |
isAggregate(org.apache.calcite.sql.SqlSelect select) |
protected boolean |
isNestedAggregateWindow(org.apache.calcite.sql.SqlNode node) |
protected boolean |
isOverAggregateWindow(org.apache.calcite.sql.SqlNode node) |
boolean |
isSystemField(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) |
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.
|
org.apache.calcite.sql.validate.SqlMoniker |
lookupQualifiedName(org.apache.calcite.sql.SqlNode topNode,
org.apache.calcite.sql.parser.SqlParserPos pos) |
org.apache.calcite.sql.SqlCall |
makeNullaryCall(org.apache.calcite.sql.SqlIdentifier id) |
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) |
protected org.apache.calcite.sql.SqlNode |
performUnconditionalRewrites(org.apache.calcite.sql.SqlNode node,
boolean underFrom)
Performs expression rewrites which are always used unconditionally.
|
void |
popFunctionCall() |
void |
pushFunctionCall() |
protected void |
registerNamespace(org.apache.calcite.sql.validate.SqlValidatorScope usingScope,
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 |
removeValidatedNodeType(org.apache.calcite.sql.SqlNode node) |
org.apache.calcite.sql.SqlWindow |
resolveWindow(org.apache.calcite.sql.SqlNode windowOrRef,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
setOriginal(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.SqlNode original) |
void |
setValidatedNodeType(org.apache.calcite.sql.SqlNode node,
org.apache.calcite.rel.type.RelDataType type)
Saves the type of a
SqlNode, now that it has been validated. |
protected boolean |
shouldAllowIntermediateOrderBy() |
protected boolean |
shouldAllowOverRelation() |
org.apache.calcite.sql.validate.SqlValidator |
transform(java.util.function.UnaryOperator<org.apache.calcite.sql.validate.SqlValidator.Config> transform) |
List<String> |
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.SqlNode |
validate(org.apache.calcite.sql.SqlNode topNode) |
void |
validateAggregateParams(org.apache.calcite.sql.SqlCall aggCall,
org.apache.calcite.sql.SqlNode filter,
org.apache.calcite.sql.SqlNodeList orderList,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateCall(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateColumnListParams(org.apache.calcite.sql.SqlFunction function,
List<org.apache.calcite.rel.type.RelDataType> argTypes,
List<org.apache.calcite.sql.SqlNode> operands) |
void |
validateDataType(org.apache.calcite.sql.SqlDataTypeSpec dataType) |
void |
validateDelete(org.apache.calcite.sql.SqlDelete call) |
void |
validateDynamicParam(org.apache.calcite.sql.SqlDynamicParam dynamicParam) |
protected void |
validateFeature(org.apache.calcite.runtime.Feature feature,
org.apache.calcite.sql.parser.SqlParserPos context)
Validates that a particular feature is enabled.
|
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.
|
protected void |
validateGroupClause(org.apache.calcite.sql.SqlSelect select)
Validates the GROUP BY clause of a SELECT statement.
|
protected void |
validateHavingClause(org.apache.calcite.sql.SqlSelect select) |
void |
validateIdentifier(org.apache.calcite.sql.SqlIdentifier id,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateInsert(org.apache.calcite.sql.SqlInsert insert) |
void |
validateIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier qualifier) |
protected void |
validateJoin(org.apache.calcite.sql.SqlJoin join,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateLiteral(org.apache.calcite.sql.SqlLiteral literal) |
void |
validateMatchRecognize(org.apache.calcite.sql.SqlCall call) |
void |
validateMerge(org.apache.calcite.sql.SqlMerge call) |
boolean |
validateModality(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.validate.SqlModality modality,
boolean fail) |
protected void |
validateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace namespace,
org.apache.calcite.rel.type.RelDataType targetRowType)
Validates a namespace.
|
protected void |
validateOrderList(org.apache.calcite.sql.SqlSelect select)
Validates the ORDER BY clause of a SELECT statement.
|
protected void |
validateOver(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
org.apache.calcite.sql.SqlNode |
validateParameterizedExpression(org.apache.calcite.sql.SqlNode topNode,
Map<String,org.apache.calcite.rel.type.RelDataType> nameToTypeMap) |
void |
validatePivot(org.apache.calcite.sql.SqlPivot pivot) |
void |
validateQuery(org.apache.calcite.sql.SqlNode node,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.rel.type.RelDataType targetRowType) |
protected void |
validateSelect(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.rel.type.RelDataType targetRowType)
Validates a SELECT statement.
|
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) |
void |
validateSequenceValue(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlIdentifier id) |
protected void |
validateUnnest(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.rel.type.RelDataType targetRowType) |
void |
validateUpdate(org.apache.calcite.sql.SqlUpdate call) |
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.
|
protected void |
validateWhereClause(org.apache.calcite.sql.SqlSelect select) |
protected void |
validateWhereOrOn(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlNode condition,
String clause) |
void |
validateWindow(org.apache.calcite.sql.SqlNode windowOrId,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlCall call) |
protected void |
validateWindowClause(org.apache.calcite.sql.SqlSelect select) |
void |
validateWith(org.apache.calcite.sql.SqlWith with,
org.apache.calcite.sql.validate.SqlValidatorScope scope) |
void |
validateWithItem(org.apache.calcite.sql.SqlWithItem withItem) |
public static final org.slf4j.Logger TRACER
public static final String UPDATE_SRC_ALIAS
public static final String UPDATE_TGT_ALIAS
public static final String UPDATE_ANON_PREFIX
protected final Map<String,SqlValidatorImpl.IdInfo> idPositions
SqlParserPos strings to the SqlIdentifier identifier objects at these
positions.protected final Map<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorScope> scopes
query node objects to the SqlValidatorScope scope created from
them.protected final Map<org.apache.calcite.sql.SqlNode,org.apache.calcite.sql.validate.SqlValidatorNamespace> namespaces
node to the namespace which describes
what columns they contain.protected final Deque<SqlValidatorImpl.FunctionParamInfo> functionCallStack
protected final org.apache.calcite.rel.type.RelDataTypeFactory typeFactory
protected final org.apache.calcite.rel.type.RelDataType unknownType
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)
opTab - Operator tablecatalogReader - Catalog readertypeFactory - Type factoryconfig - Configpublic org.apache.calcite.sql.validate.SqlConformance getConformance()
public org.apache.calcite.sql.validate.SqlValidatorCatalogReader getCatalogReader()
getCatalogReader 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.SqlOperatorTable getOperatorTable()
getOperatorTable 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.rel.type.RelDataTypeFactory getTypeFactory()
getTypeFactory 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.rel.type.RelDataType getUnknownType()
getUnknownType 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.SqlNodeList expandStar(org.apache.calcite.sql.SqlNodeList selectList,
org.apache.calcite.sql.SqlSelect select,
boolean includeSystemVars)
expandStar 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void declareCursor(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.validate.SqlValidatorScope parentScope)
declareCursor 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void pushFunctionCall()
pushFunctionCall 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void popFunctionCall()
popFunctionCall 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic String getParentCursor(String columnListParamName)
getParentCursor 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic List<String> usingNames(org.apache.calcite.sql.SqlJoin join)
public org.apache.calcite.sql.SqlNode validate(org.apache.calcite.sql.SqlNode topNode)
validate 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic List<org.apache.calcite.sql.validate.SqlMoniker> lookupHints(org.apache.calcite.sql.SqlNode topNode, org.apache.calcite.sql.parser.SqlParserPos pos)
lookupHints 在接口中 org.apache.calcite.sql.validate.SqlValidatorWithHintspublic org.apache.calcite.sql.validate.SqlMoniker lookupQualifiedName(org.apache.calcite.sql.SqlNode topNode,
org.apache.calcite.sql.parser.SqlParserPos pos)
lookupQualifiedName 在接口中 org.apache.calcite.sql.validate.SqlValidatorWithHintspublic 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)
scope - Validation scopenames - Components of the identifierpos - positionhintList - a list of valid optionspublic org.apache.calcite.sql.SqlNode validateParameterizedExpression(org.apache.calcite.sql.SqlNode topNode,
Map<String,org.apache.calcite.rel.type.RelDataType> nameToTypeMap)
validateParameterizedExpression 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateQuery(org.apache.calcite.sql.SqlNode node,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.rel.type.RelDataType targetRowType)
validateQuery 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateNamespace(org.apache.calcite.sql.validate.SqlValidatorNamespace namespace,
org.apache.calcite.rel.type.RelDataType targetRowType)
namespace - NamespacetargetRowType - Desired row type, must not be null, may be the data type 'unknown'.public org.apache.calcite.sql.validate.SqlValidatorScope getEmptyScope()
public org.apache.calcite.sql.validate.SqlValidatorScope getCursorScope(org.apache.calcite.sql.SqlSelect select)
public org.apache.calcite.sql.validate.SqlValidatorScope getWhereScope(org.apache.calcite.sql.SqlSelect select)
getWhereScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getSelectScope(org.apache.calcite.sql.SqlSelect select)
getSelectScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SelectScope getRawSelectScope(org.apache.calcite.sql.SqlSelect select)
getRawSelectScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getHavingScope(org.apache.calcite.sql.SqlSelect select)
getHavingScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getGroupScope(org.apache.calcite.sql.SqlSelect select)
getGroupScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getFromScope(org.apache.calcite.sql.SqlSelect select)
getFromScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getOrderScope(org.apache.calcite.sql.SqlSelect select)
getOrderScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getMatchRecognizeScope(SqlMatchRecognize node)
getMatchRecognizeScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getJoinScope(org.apache.calcite.sql.SqlNode node)
getJoinScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getOverScope(org.apache.calcite.sql.SqlNode node)
getOverScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorNamespace getNamespace(org.apache.calcite.sql.SqlNode node)
getNamespace 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected org.apache.calcite.sql.SqlNode performUnconditionalRewrites(org.apache.calcite.sql.SqlNode node,
boolean underFrom)
node - expression to be rewrittenunderFrom - whether node appears directly under a FROM clauseprotected org.apache.calcite.sql.SqlNode getSelfJoinExprForUpdate(org.apache.calcite.sql.SqlNode table,
String alias)
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.protected org.apache.calcite.sql.SqlSelect createSourceSelectForUpdate(org.apache.calcite.sql.SqlUpdate call)
call - Call to the UPDATE operatorprotected org.apache.calcite.sql.SqlSelect createSourceSelectForDelete(org.apache.calcite.sql.SqlDelete call)
call - Call to the DELETE operatorpublic org.apache.calcite.rel.type.RelDataType getValidatedNodeType(org.apache.calcite.sql.SqlNode node)
getValidatedNodeType 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.rel.type.RelDataType getValidatedNodeTypeIfKnown(org.apache.calcite.sql.SqlNode node)
getValidatedNodeTypeIfKnown 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic final void setValidatedNodeType(org.apache.calcite.sql.SqlNode node,
org.apache.calcite.rel.type.RelDataType type)
SqlNode, 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.
setValidatedNodeType 在接口中 org.apache.calcite.sql.validate.SqlValidatornode - A SQL parse tree node, never nulltype - Its type; must not be nullpublic void removeValidatedNodeType(org.apache.calcite.sql.SqlNode node)
removeValidatedNodeType 在接口中 org.apache.calcite.sql.validate.SqlValidator@Nullable public org.apache.calcite.sql.SqlCall makeNullaryCall(org.apache.calcite.sql.SqlIdentifier id)
makeNullaryCall 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.rel.type.RelDataType deriveType(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlNode expr)
deriveType 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic 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,
org.apache.calcite.sql.SqlFunction resolvedConstructor,
List<org.apache.calcite.rel.type.RelDataType> argTypes)
deriveConstructorType 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.runtime.CalciteException handleUnresolvedFunction(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.SqlFunction unresolvedFunction,
List<org.apache.calcite.rel.type.RelDataType> argTypes,
List<String> argNames)
handleUnresolvedFunction 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void inferUnknownTypes(@Nonnull org.apache.calcite.rel.type.RelDataType inferredType, @Nonnull org.apache.calcite.sql.validate.SqlValidatorScope scope, @Nonnull org.apache.calcite.sql.SqlNode node)
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)
public String deriveAlias(org.apache.calcite.sql.SqlNode node, int ordinal)
deriveAlias 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected boolean shouldAllowIntermediateOrderBy()
protected org.apache.calcite.sql.validate.MatchRecognizeNamespace createMatchRecognizeNameSpace(SqlMatchRecognize call, org.apache.calcite.sql.SqlNode enclosingNode)
protected org.apache.calcite.sql.validate.PivotNamespace createPivotNameSpace(org.apache.calcite.sql.SqlPivot call,
org.apache.calcite.sql.SqlNode enclosingNode)
protected void registerNamespace(org.apache.calcite.sql.validate.SqlValidatorScope usingScope,
String alias,
org.apache.calcite.sql.validate.SqlValidatorNamespace ns,
boolean forceNullable)
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 boolean shouldAllowOverRelation()
protected org.apache.calcite.sql.validate.SelectNamespace createSelectNamespace(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.SqlNode enclosingNode)
SELECT node. Derived class may override this factory
method.select - Select nodeenclosingNode - Enclosing nodeprotected org.apache.calcite.sql.validate.SetopNamespace createSetopNamespace(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.SqlNode enclosingNode)
UNION,
INTERSECT, or EXCEPT). Derived class may override this factory method.call - Call to set operationenclosingNode - Enclosing nodepublic boolean isAggregate(org.apache.calcite.sql.SqlSelect select)
isAggregate 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected boolean isNestedAggregateWindow(org.apache.calcite.sql.SqlNode node)
protected boolean isOverAggregateWindow(org.apache.calcite.sql.SqlNode node)
protected org.apache.calcite.sql.SqlNode getAggregate(org.apache.calcite.sql.SqlSelect select)
select to 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.
@Deprecated public boolean isAggregate(org.apache.calcite.sql.SqlNode selectNode)
isAggregate 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateIdentifier(org.apache.calcite.sql.SqlIdentifier id,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
validateIdentifier 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateLiteral(org.apache.calcite.sql.SqlLiteral literal)
validateLiteral 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateIntervalQualifier(org.apache.calcite.sql.SqlIntervalQualifier qualifier)
validateIntervalQualifier 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateFrom(org.apache.calcite.sql.SqlNode node,
org.apache.calcite.rel.type.RelDataType targetRowType,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
node - Node in FROM clause, typically a table or derived tabletargetRowType - Desired row type of this expression, or unknownType if not
fussy. Must not be null.scope - Scopeprotected void validateOver(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
protected void validateUnnest(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.rel.type.RelDataType targetRowType)
protected void validateJoin(org.apache.calcite.sql.SqlJoin join,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
protected void validateSelect(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.rel.type.RelDataType targetRowType)
select - Select statementtargetRowType - Desired row type, must not be null, may be the data type 'unknown'.public boolean validateModality(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.validate.SqlModality modality,
boolean fail)
validateModality 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateWindowClause(org.apache.calcite.sql.SqlSelect select)
public void validateWith(org.apache.calcite.sql.SqlWith with,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
validateWith 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateWithItem(org.apache.calcite.sql.SqlWithItem withItem)
validateWithItem 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateSequenceValue(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlIdentifier id)
validateSequenceValue 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorScope getWithScope(org.apache.calcite.sql.SqlNode withItem)
getWithScope 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.implicit.TypeCoercion getTypeCoercion()
getTypeCoercion 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidator.Config config()
config 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidator transform(java.util.function.UnaryOperator<org.apache.calcite.sql.validate.SqlValidator.Config> transform)
transform 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateOrderList(org.apache.calcite.sql.SqlSelect select)
select - Select statementpublic org.apache.calcite.sql.SqlNode expandOrderExpr(org.apache.calcite.sql.SqlSelect select,
org.apache.calcite.sql.SqlNode orderExpr)
expandOrderExpr 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateGroupClause(org.apache.calcite.sql.SqlSelect select)
protected void validateWhereClause(org.apache.calcite.sql.SqlSelect select)
protected void validateWhereOrOn(org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlNode condition,
String clause)
protected void validateHavingClause(org.apache.calcite.sql.SqlSelect select)
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)
protected org.apache.calcite.rel.type.RelDataType createTargetRowType(org.apache.calcite.sql.validate.SqlValidatorTable table,
org.apache.calcite.sql.SqlNodeList targetColumnList,
boolean append)
table - Target table for INSERT/UPDATEtargetColumnList - List of target columns, or null if not specifiedappend - Whether to append fields to those in
baseRowTypepublic void validateInsert(org.apache.calcite.sql.SqlInsert insert)
validateInsert 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected org.apache.calcite.rel.type.RelDataType getLogicalTargetRowType(org.apache.calcite.rel.type.RelDataType targetRowType,
org.apache.calcite.sql.SqlInsert insert)
protected org.apache.calcite.rel.type.RelDataType getLogicalSourceRowType(org.apache.calcite.rel.type.RelDataType sourceRowType,
org.apache.calcite.sql.SqlInsert insert)
protected void checkTypeAssignment(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)
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.
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 querypublic void validateDelete(org.apache.calcite.sql.SqlDelete call)
validateDelete 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateUpdate(org.apache.calcite.sql.SqlUpdate call)
validateUpdate 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateMerge(org.apache.calcite.sql.SqlMerge call)
validateMerge 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateValues(org.apache.calcite.sql.SqlCall node,
org.apache.calcite.rel.type.RelDataType targetRowType,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
node - Values clausetargetRowType - Row type which expression must conform toscope - Scope within which clause occurspublic void validateDataType(org.apache.calcite.sql.SqlDataTypeSpec dataType)
validateDataType 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateDynamicParam(org.apache.calcite.sql.SqlDynamicParam dynamicParam)
validateDynamicParam 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.validate.SqlValidatorImpl.ValidationErrorFunction getValidationErrorFunction()
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)
newValidationError 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected org.apache.calcite.sql.SqlWindow getWindowByName(org.apache.calcite.sql.SqlIdentifier id,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
public org.apache.calcite.sql.SqlWindow resolveWindow(org.apache.calcite.sql.SqlNode windowOrRef,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
resolveWindow 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.SqlNode getOriginal(org.apache.calcite.sql.SqlNode expr)
public void setOriginal(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.SqlNode original)
public void validateWindow(org.apache.calcite.sql.SqlNode windowOrId,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlCall call)
validateWindow 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateMatchRecognize(org.apache.calcite.sql.SqlCall call)
validateMatchRecognize 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validatePivot(org.apache.calcite.sql.SqlPivot pivot)
public void validateAggregateParams(org.apache.calcite.sql.SqlCall aggCall,
org.apache.calcite.sql.SqlNode filter,
org.apache.calcite.sql.SqlNodeList orderList,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
validateAggregateParams 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic void validateCall(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
validateCall 在接口中 org.apache.calcite.sql.validate.SqlValidatorprotected void validateFeature(org.apache.calcite.runtime.Feature feature,
org.apache.calcite.sql.parser.SqlParserPos context)
feature - feature being used, represented as a resource instancecontext - parser position context for error reporting, or null ifpublic 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)
public org.apache.calcite.sql.SqlNode expand(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.validate.SqlValidatorScope scope)
expand 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.sql.SqlNode expandGroupByOrHavingExpr(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlSelect select,
boolean havingExpression)
public boolean isSystemField(org.apache.calcite.rel.type.RelDataTypeField field)
isSystemField 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic List<List<String>> getFieldOrigins(org.apache.calcite.sql.SqlNode sqlQuery)
getFieldOrigins 在接口中 org.apache.calcite.sql.validate.SqlValidatorpublic org.apache.calcite.rel.type.RelDataType getParameterRowType(org.apache.calcite.sql.SqlNode sqlQuery)
getParameterRowType 在接口中 org.apache.calcite.sql.validate.SqlValidatorCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.