本文整理汇总了Java中org.apache.calcite.sql.SqlKind.OTHER属性的典型用法代码示例。如果您正苦于以下问题:Java SqlKind.OTHER属性的具体用法?Java SqlKind.OTHER怎么用?Java SqlKind.OTHER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.calcite.sql.SqlKind
的用法示例。
在下文中一共展示了SqlKind.OTHER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toTreeEx
/**
* Converts a list of {expression, operator, expression, ...} into a tree,
* taking operator precedence and associativity into account.
*
* @param list List of operands and operators. This list is modified as
* expressions are reduced.
* @param start Position of first operand in the list. Anything to the
* left of this (besides the immediately preceding operand)
* is ignored. Generally use value 1.
* @param minPrec Minimum precedence to consider. If the method encounters
* an operator of lower precedence, it doesn't reduce any
* further.
* @param stopperKind If not {@link SqlKind#OTHER}, stop reading the list if
* we encounter a token of this kind.
* @return the root node of the tree which the list condenses into
*/
public static SqlNode toTreeEx(SqlSpecialOperator.TokenSequence list,
int start, final int minPrec, final SqlKind stopperKind) {
final Predicate<PrecedenceClimbingParser.Token> predicate =
new PredicateImpl<PrecedenceClimbingParser.Token>() {
public boolean test(PrecedenceClimbingParser.Token t) {
if (t instanceof PrecedenceClimbingParser.Op) {
final SqlOperator op = ((ToTreeListItem) t.o).op;
return stopperKind != SqlKind.OTHER
&& op.kind == stopperKind
|| minPrec > 0
&& op.getLeftPrec() < minPrec;
} else {
return false;
}
}
};
PrecedenceClimbingParser parser = list.parser(start, predicate);
final int beforeSize = parser.all().size();
parser.partialParse();
final int afterSize = parser.all().size();
final SqlNode node = convert(parser.all().get(0));
list.replaceSublist(start, start + beforeSize - afterSize + 1, node);
return node;
}
示例2: SqlMultisetMemberOfOperator
public SqlMultisetMemberOfOperator() {
// TODO check if precedence is correct
super(
"MEMBER OF",
SqlKind.OTHER,
30,
true,
ReturnTypes.BOOLEAN_NULLABLE,
null,
null);
}
示例3: SqlDatePartFunction
public SqlDatePartFunction(String name, TimeUnit timeUnit) {
super(name,
SqlKind.OTHER,
ReturnTypes.BIGINT_NULLABLE,
InferTypes.FIRST_KNOWN,
OperandTypes.DATETIME,
SqlFunctionCategory.TIMEDATE);
this.timeUnit = timeUnit;
}
示例4: SqlThrowOperator
public SqlThrowOperator() {
super(
"$throw",
SqlKind.OTHER,
2,
true,
ReturnTypes.BOOLEAN,
null,
OperandTypes.CHARACTER);
}
示例5: SqlMultisetSetOperator
public SqlMultisetSetOperator(String name, int prec, boolean all) {
super(
name,
SqlKind.OTHER,
prec,
true,
ReturnTypes.MULTISET_NULLABLE,
InferTypes.FIRST_KNOWN,
OperandTypes.MULTISET_MULTISET);
this.all = all;
}
示例6: getKind
/**
* Returns the kind of node this is.
*
* @return Node kind, never null
*/
public SqlKind getKind() {
return SqlKind.OTHER;
}