Class SqlLikeOperator
LIKE and SIMILAR
 operators.
 Syntax of the two operators:
- src-value [NOT] LIKE pattern-value [ESCAPE escape-value]
- src-value [NOT] SIMILAR pattern-value [ESCAPE escape-value]
NOTE If the NOT clause is present the
 parser will generate a
 equivalent to NOT (src LIKE pattern ...)
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.calcite.sql.SqlSpecialOperatorSqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence
- 
Field SummaryFields inherited from class org.apache.calcite.sql.SqlOperatorkind, MDX_PRECEDENCE, NL
- 
Method SummaryModifier and TypeMethodDescriptionbooleancheckOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) Checks that the operand values in aSqlCallto this operator are valid.Returns a constraint on the number of operands expected by this operator.booleanReturns whether this operator matches the case of its operands.booleanReturns whether this is the 'NOT LIKE' operator.not()Returns the operator that is the logical inverse of this operator.reduceExpr(int opOrdinal, SqlSpecialOperator.TokenSequence list) Reduces a list of operators and arguments according to the rules of precedence and associativity.voidWrites a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.voidvalidateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Validates a call to this operator.booleanvalidRexOperands(int count, Litmus litmus) Returns whether the given operands are valid.Methods inherited from class org.apache.calcite.sql.SqlSpecialOperatorgetSyntaxMethods inherited from class org.apache.calcite.sql.SqlOperatoracceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getNameAsId, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getSqlCallFactory, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands
- 
Method Details- 
isNegatedpublic boolean isNegated()Returns whether this is the 'NOT LIKE' operator.- Returns:
- whether this is 'NOT LIKE'
- See Also:
 
- 
isCaseSensitivepublic boolean isCaseSensitive()Returns whether this operator matches the case of its operands. For example, returns true forLIKEand false forILIKE.- Returns:
- whether this operator matches the case of its operands
 
- 
notDescription copied from class:SqlOperatorReturns the operator that is the logical inverse of this operator.For example, SqlStdOperatorTable.LIKE.not()returnsSqlStdOperatorTable.NOT_LIKE, and vice versa.By default, returns null, which means there is no inverse operator.- Overrides:
- notin class- SqlOperator
- See Also:
 
- 
getOperandCountRangeDescription copied from class:SqlOperatorReturns a constraint on the number of operands expected by this operator. Subclasses may override this method; when they don't, the range is derived from theSqlOperandTypeCheckerassociated with this operator.- Overrides:
- getOperandCountRangein class- SqlOperator
- Returns:
- acceptable range
 
- 
checkOperandTypesDescription copied from class:SqlOperatorChecks that the operand values in aSqlCallto this operator are valid. Subclasses must either override this method or supply an instance ofSqlOperandTypeCheckerto the constructor.- Overrides:
- checkOperandTypesin class- SqlOperator
- Parameters:
- callBinding- description of call
- throwOnFailure- whether to throw an exception if check fails (otherwise returns false in that case)
- Returns:
- whether check succeeded
 
- 
validateCallpublic void validateCall(SqlCall call, SqlValidator validator, SqlValidatorScope scope, SqlValidatorScope operandScope) Description copied from class:SqlOperatorValidates a call to this operator.This method should not perform type-derivation or perform validation related related to types. That is done later, by SqlOperator.deriveType(SqlValidator, SqlValidatorScope, SqlCall). This method should focus on structural validation.A typical implementation of this method first validates the operands, then performs some operator-specific logic. The default implementation just validates the operands. This method is the default implementation of SqlCall.validate(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope); but note that some sub-classes ofSqlCallnever call this method.- Overrides:
- validateCallin class- SqlOperator
- Parameters:
- call- the call to this operator
- validator- the active validator
- scope- validator scope
- operandScope- validator scope in which to validate operands to this call; usually equal to scope, but not always because some operators introduce new scopes
- See Also:
 
- 
validRexOperandsDescription copied from class:SqlOperatorReturns whether the given operands are valid. If not valid andfail, throws an assertion error.Similar to SqlOperator.checkOperandCount(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.type.SqlOperandTypeChecker, org.apache.calcite.sql.SqlCall), but some operators may have different valid operands inSqlNodeandRexNodeformats (some examples are CAST and AND), and this method throws internal errors, not user errors.- Overrides:
- validRexOperandsin class- SqlOperator
 
- 
unparseDescription copied from class:SqlOperatorWrites a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.The default implementation of this method delegates to SqlSyntax.unparse(org.apache.calcite.sql.SqlWriter, org.apache.calcite.sql.SqlOperator, org.apache.calcite.sql.SqlCall, int, int).- Overrides:
- unparsein class- SqlOperator
 
- 
reduceExprpublic SqlSpecialOperator.ReduceResult reduceExpr(int opOrdinal, SqlSpecialOperator.TokenSequence list) Description copied from class:SqlSpecialOperatorReduces a list of operators and arguments according to the rules of precedence and associativity. Returns the ordinal of the node which replaced the expression.The default implementation throws UnsupportedOperationException.- Overrides:
- reduceExprin class- SqlSpecialOperator
- Parameters:
- opOrdinal- indicating the ordinal of the current operator in the list on which a possible reduction can be made
- list- List of alternating- SqlParserUtil.ToTreeListItemand- SqlNode
- Returns:
- ordinal of the node which replaced the expression
 
 
-