Class SqlMatchRecognize
- java.lang.Object
-
- org.apache.calcite.sql.SqlNode
-
- org.apache.calcite.sql.SqlCall
-
- org.apache.calcite.sql.SqlMatchRecognize
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SqlMatchRecognize extends SqlCall
SqlNode for MATCH_RECOGNIZE clause.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SqlMatchRecognize.AfterOption
Options forAFTER MATCH
clause.static class
SqlMatchRecognize.RowsPerMatchOption
Options forROWS PER MATCH
.static class
SqlMatchRecognize.SqlMatchRecognizeOperator
An operator describing a MATCH_RECOGNIZE specification.
-
Field Summary
Fields Modifier and Type Field Description private SqlNode
after
private SqlLiteral
interval
private SqlNodeList
measureList
static int
OPERAND_AFTER
static int
OPERAND_INTERVAL
static int
OPERAND_MEASURES
static int
OPERAND_ORDER_BY
static int
OPERAND_PARTITION_BY
static int
OPERAND_PATTERN
static int
OPERAND_PATTERN_DEFINES
static int
OPERAND_ROWS_PER_MATCH
static int
OPERAND_STRICT_END
static int
OPERAND_STRICT_START
static int
OPERAND_SUBSET
static int
OPERAND_TABLE_REF
private SqlNodeList
orderList
private SqlNodeList
partitionList
private SqlNode
pattern
private SqlNodeList
patternDefList
private SqlLiteral
rowsPerMatch
static SqlPrefixOperator
SKIP_TO_FIRST
static SqlPrefixOperator
SKIP_TO_LAST
private SqlLiteral
strictEnd
private SqlLiteral
strictStart
private SqlNodeList
subsetList
private SqlNode
tableRef
-
Fields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos
-
-
Constructor Summary
Constructors Constructor Description SqlMatchRecognize(SqlParserPos pos, SqlNode tableRef, SqlNode pattern, SqlLiteral strictStart, SqlLiteral strictEnd, SqlNodeList patternDefList, SqlNodeList measureList, SqlNode after, SqlNodeList subsetList, SqlLiteral rowsPerMatch, SqlNodeList partitionList, SqlNodeList orderList, SqlLiteral interval)
Creates a SqlMatchRecognize.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlNode
getAfter()
SqlLiteral
getInterval()
SqlKind
getKind()
Returns the type of node this is, orSqlKind.OTHER
if it's nothing special.SqlNodeList
getMeasureList()
java.util.List<SqlNode>
getOperandList()
SqlOperator
getOperator()
SqlNodeList
getOrderList()
SqlNodeList
getPartitionList()
SqlNode
getPattern()
SqlNodeList
getPatternDefList()
SqlLiteral
getRowsPerMatch()
SqlLiteral
getStrictEnd()
SqlLiteral
getStrictStart()
SqlNodeList
getSubsetList()
SqlNode
getTableRef()
void
setOperand(int i, SqlNode operand)
Changes the value of an operand.void
unparse(SqlWriter writer, int leftPrec, int rightPrec)
Writes a SQL representation of this node to a writer.void
validate(SqlValidator validator, SqlValidatorScope scope)
Validates this call.-
Methods inherited from class org.apache.calcite.sql.SqlCall
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getMonotonicity, isCountStar, isExpanded, operand, operandCount
-
Methods inherited from class org.apache.calcite.sql.SqlNode
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toSqlString, toSqlString, toString, validateExpr
-
-
-
-
Field Detail
-
OPERAND_TABLE_REF
public static final int OPERAND_TABLE_REF
- See Also:
- Constant Field Values
-
OPERAND_PATTERN
public static final int OPERAND_PATTERN
- See Also:
- Constant Field Values
-
OPERAND_STRICT_START
public static final int OPERAND_STRICT_START
- See Also:
- Constant Field Values
-
OPERAND_STRICT_END
public static final int OPERAND_STRICT_END
- See Also:
- Constant Field Values
-
OPERAND_PATTERN_DEFINES
public static final int OPERAND_PATTERN_DEFINES
- See Also:
- Constant Field Values
-
OPERAND_MEASURES
public static final int OPERAND_MEASURES
- See Also:
- Constant Field Values
-
OPERAND_AFTER
public static final int OPERAND_AFTER
- See Also:
- Constant Field Values
-
OPERAND_SUBSET
public static final int OPERAND_SUBSET
- See Also:
- Constant Field Values
-
OPERAND_ROWS_PER_MATCH
public static final int OPERAND_ROWS_PER_MATCH
- See Also:
- Constant Field Values
-
OPERAND_PARTITION_BY
public static final int OPERAND_PARTITION_BY
- See Also:
- Constant Field Values
-
OPERAND_ORDER_BY
public static final int OPERAND_ORDER_BY
- See Also:
- Constant Field Values
-
OPERAND_INTERVAL
public static final int OPERAND_INTERVAL
- See Also:
- Constant Field Values
-
SKIP_TO_FIRST
public static final SqlPrefixOperator SKIP_TO_FIRST
-
SKIP_TO_LAST
public static final SqlPrefixOperator SKIP_TO_LAST
-
tableRef
private SqlNode tableRef
-
pattern
private SqlNode pattern
-
strictStart
private SqlLiteral strictStart
-
strictEnd
private SqlLiteral strictEnd
-
patternDefList
private SqlNodeList patternDefList
-
measureList
private SqlNodeList measureList
-
after
private SqlNode after
-
subsetList
private SqlNodeList subsetList
-
rowsPerMatch
private SqlLiteral rowsPerMatch
-
partitionList
private SqlNodeList partitionList
-
orderList
private SqlNodeList orderList
-
interval
private SqlLiteral interval
-
-
Constructor Detail
-
SqlMatchRecognize
public SqlMatchRecognize(SqlParserPos pos, SqlNode tableRef, SqlNode pattern, SqlLiteral strictStart, SqlLiteral strictEnd, SqlNodeList patternDefList, SqlNodeList measureList, SqlNode after, SqlNodeList subsetList, SqlLiteral rowsPerMatch, SqlNodeList partitionList, SqlNodeList orderList, SqlLiteral interval)
Creates a SqlMatchRecognize.
-
-
Method Detail
-
getOperator
public SqlOperator getOperator()
- Specified by:
getOperator
in classSqlCall
-
getKind
public SqlKind getKind()
Description copied from class:SqlNode
Returns the type of node this is, orSqlKind.OTHER
if it's nothing special.- Overrides:
getKind
in classSqlCall
- Returns:
- a
SqlKind
value, never null - See Also:
SqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)
-
getOperandList
public java.util.List<SqlNode> getOperandList()
- Specified by:
getOperandList
in classSqlCall
-
unparse
public void unparse(SqlWriter writer, int leftPrec, int rightPrec)
Description copied from class:SqlNode
Writes a SQL representation of this node to a writer.The
leftPrec
andrightPrec
parameters give us enough context to decide whether we need to enclose the expression in parentheses. For example, we need parentheses around "2 + 3" if preceded by "5 *". This is because the precedence of the "*" operator is greater than the precedence of the "+" operator.The algorithm handles left- and right-associative operators by giving them slightly different left- and right-precedence.
If
SqlWriter.isAlwaysUseParentheses()
is true, we use parentheses even when they are not required by the precedence rules.For the details of this algorithm, see
SqlCall.unparse(org.apache.calcite.sql.SqlWriter, int, int)
.
-
validate
public void validate(SqlValidator validator, SqlValidatorScope scope)
Description copied from class:SqlCall
Validates this call.The default implementation delegates the validation to the operator's
SqlOperator.validateCall(org.apache.calcite.sql.SqlCall, org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.validate.SqlValidatorScope)
. Derived classes may override (as do, for exampleSqlSelect
andSqlUpdate
).
-
setOperand
public void setOperand(int i, SqlNode operand)
Description copied from class:SqlCall
Changes the value of an operand. Allows some rewrite bySqlValidator
; use sparingly.- Overrides:
setOperand
in classSqlCall
- Parameters:
i
- Operand indexoperand
- Operand value
-
getTableRef
@Nonnull public SqlNode getTableRef()
-
getPattern
public SqlNode getPattern()
-
getStrictStart
public SqlLiteral getStrictStart()
-
getStrictEnd
public SqlLiteral getStrictEnd()
-
getPatternDefList
@Nonnull public SqlNodeList getPatternDefList()
-
getMeasureList
@Nonnull public SqlNodeList getMeasureList()
-
getAfter
public SqlNode getAfter()
-
getSubsetList
public SqlNodeList getSubsetList()
-
getRowsPerMatch
public SqlLiteral getRowsPerMatch()
-
getPartitionList
public SqlNodeList getPartitionList()
-
getOrderList
public SqlNodeList getOrderList()
-
getInterval
public SqlLiteral getInterval()
-
-