本文整理汇总了Java中org.apache.calcite.sql.SqlOperandCountRange类的典型用法代码示例。如果您正苦于以下问题:Java SqlOperandCountRange类的具体用法?Java SqlOperandCountRange怎么用?Java SqlOperandCountRange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlOperandCountRange类属于org.apache.calcite.sql包,在下文中一共展示了SqlOperandCountRange类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: variadic
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public static SqlOperandTypeChecker variadic(
final SqlOperandCountRange range) {
return new SqlOperandTypeChecker() {
public boolean checkOperandTypes(
SqlCallBinding callBinding,
boolean throwOnFailure) {
return range.isValidCount(callBinding.getOperandCount());
}
public SqlOperandCountRange getOperandCountRange() {
return range;
}
public String getAllowedSignatures(SqlOperator op, String opName) {
return opName + "(...)";
}
public boolean isOptional(int i) {
return false;
}
public Consistency getConsistency() {
return Consistency.NONE;
}
};
}
开发者ID:apache,项目名称:calcite,代码行数:27,代码来源:OperandTypes.java
示例2: repeat
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
/**
* Creates a checker that passes if all of the rules pass for each operand,
* using a given operand count strategy.
*/
public static SqlOperandTypeChecker repeat(SqlOperandCountRange range,
SqlSingleOperandTypeChecker... rules) {
return new CompositeOperandTypeChecker(
CompositeOperandTypeChecker.Composition.REPEAT,
ImmutableList.copyOf(rules), null, range);
}
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:OperandTypes.java
示例3: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
if (nOperands == -1) {
return SqlOperandCountRanges.any();
} else {
return SqlOperandCountRanges.of(nOperands);
}
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SameOperandTypeChecker.java
示例4: CompositeOperandTypeChecker
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
/**
* Package private. Use {@link OperandTypes#and},
* {@link OperandTypes#or}.
*/
CompositeOperandTypeChecker(
Composition composition,
ImmutableList<? extends SqlOperandTypeChecker> allowedRules,
@Nullable String allowedSignatures,
@Nullable SqlOperandCountRange range) {
this.allowedRules = Preconditions.checkNotNull(allowedRules);
this.composition = Preconditions.checkNotNull(composition);
this.allowedSignatures = allowedSignatures;
this.range = range;
assert (range != null) == (composition == Composition.REPEAT);
assert allowedRules.size() + (range == null ? 0 : 1) > 1;
}
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:CompositeOperandTypeChecker.java
示例5: minMin
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
private int minMin(List<SqlOperandCountRange> ranges) {
int min = Integer.MAX_VALUE;
for (SqlOperandCountRange range : ranges) {
min = Math.min(min, range.getMax());
}
return min;
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:CompositeOperandTypeChecker.java
示例6: maxMax
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
private int maxMax(List<SqlOperandCountRange> ranges) {
int max = Integer.MIN_VALUE;
for (SqlOperandCountRange range : ranges) {
if (range.getMax() < 0) {
if (composition == Composition.OR) {
return -1;
}
} else {
max = Math.max(max, range.getMax());
}
}
return max;
}
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:CompositeOperandTypeChecker.java
示例7: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
final int max = families.size();
int min = max;
while (min > 0 && optional.apply(min - 1)) {
--min;
}
return SqlOperandCountRanges.between(min, max);
}
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:FamilyOperandTypeChecker.java
示例8: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
@Override
public SqlOperandCountRange getOperandCountRange() {
return range;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:Checker.java
示例9: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.between(1, 2);
}
开发者ID:axbaretto,项目名称:flink,代码行数:4,代码来源:SqlStdOperatorTable.java
示例10: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.of(2);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlMultisetMemberOfOperator.java
示例11: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.between(2, 3);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlSubstringFunction.java
示例12: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.of(1);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlDatePartFunction.java
示例13: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.any();
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlCaseOperator.java
示例14: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
@Override public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.of(2);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlItemOperator.java
示例15: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.between(1, 2);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlStdOperatorTable.java
示例16: of
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public static SqlOperandCountRange of(int length) {
return new RangeImpl(length, length);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlOperandCountRanges.java
示例17: between
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public static SqlOperandCountRange between(int min, int max) {
return new RangeImpl(min, max);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlOperandCountRanges.java
示例18: from
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public static SqlOperandCountRange from(int min) {
return new RangeImpl(min, -1);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlOperandCountRanges.java
示例19: any
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public static SqlOperandCountRange any() {
return new RangeImpl(0, -1);
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SqlOperandCountRanges.java
示例20: getOperandCountRange
import org.apache.calcite.sql.SqlOperandCountRange; //导入依赖的package包/类
public SqlOperandCountRange getOperandCountRange() {
return SqlOperandCountRanges.of(paramTypes.size());
}
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:AssignableOperandTypeChecker.java
注:本文中的org.apache.calcite.sql.SqlOperandCountRange类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论