本文整理汇总了Java中org.apache.calcite.sql.type.SqlOperandTypeChecker类的典型用法代码示例。如果您正苦于以下问题:Java SqlOperandTypeChecker类的具体用法?Java SqlOperandTypeChecker怎么用?Java SqlOperandTypeChecker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlOperandTypeChecker类属于org.apache.calcite.sql.type包,在下文中一共展示了SqlOperandTypeChecker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: convertCall
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/** Converts a {@link SqlCall} to a {@link RexCall} with a perhaps different
* operator. */
private RexNode convertCall(
SqlRexContext cx,
SqlCall call,
SqlOperator op) {
final List<SqlNode> operands = call.getOperandList();
final RexBuilder rexBuilder = cx.getRexBuilder();
final SqlOperandTypeChecker.Consistency consistency =
op.getOperandTypeChecker() == null
? SqlOperandTypeChecker.Consistency.NONE
: op.getOperandTypeChecker().getConsistency();
final List<RexNode> exprs =
convertExpressionList(cx, operands, consistency);
RelDataType type = rexBuilder.deriveReturnType(op, exprs);
return rexBuilder.makeCall(type, op, RexUtil.flatten(exprs, op));
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:18,代码来源:ConvertletTable.java
示例2: convertExpressionList
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
private static List<RexNode> convertExpressionList(SqlRexContext cx,
List<SqlNode> nodes, SqlOperandTypeChecker.Consistency consistency) {
final List<RexNode> exprs = Lists.newArrayList();
for (SqlNode node : nodes) {
exprs.add(cx.convertExpression(node));
}
if (exprs.size() > 1) {
final RelDataType type =
consistentType(cx, consistency, RexUtil.types(exprs));
if (type != null) {
final List<RexNode> oldExprs = Lists.newArrayList(exprs);
exprs.clear();
for (RexNode expr : oldExprs) {
exprs.add(cx.getRexBuilder().ensureType(type, expr, true));
}
}
}
return exprs;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:20,代码来源:ConvertletTable.java
示例3: convertFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public RexNode convertFunction(
SqlRexContext cx,
SqlFunction fun,
SqlCall call) {
final List<SqlNode> operands = call.getOperandList();
final List<RexNode> exprs = convertExpressionList(cx, operands,
SqlOperandTypeChecker.Consistency.NONE);
if (fun.getFunctionType() == SqlFunctionCategory.USER_DEFINED_CONSTRUCTOR) {
return makeConstructorCall(cx, fun, exprs);
}
RelDataType returnType =
cx.getValidator().getValidatedNodeTypeIfKnown(call);
if (returnType == null) {
returnType = cx.getRexBuilder().deriveReturnType(fun, exprs);
}
return cx.getRexBuilder().makeCall(returnType, fun, exprs);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:StandardConvertletTable.java
示例4: convertAggregateFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public RexNode convertAggregateFunction(
SqlRexContext cx,
SqlAggFunction fun,
SqlCall call) {
final List<SqlNode> operands = call.getOperandList();
final List<RexNode> exprs;
if (call.isCountStar()) {
exprs = ImmutableList.of();
} else {
exprs = convertExpressionList(cx, operands,
SqlOperandTypeChecker.Consistency.NONE);
}
RelDataType returnType =
cx.getValidator().getValidatedNodeTypeIfKnown(call);
final int groupCount = cx.getGroupCount();
if (returnType == null) {
RexCallBinding binding =
new RexCallBinding(cx.getTypeFactory(), fun, exprs, ImmutableList.<RelCollation>of()) {
@Override public int getGroupCount() {
return groupCount;
}
};
returnType = fun.inferReturnType(binding);
}
return cx.getRexBuilder().makeCall(returnType, fun, exprs);
}
开发者ID:apache,项目名称:calcite,代码行数:27,代码来源:StandardConvertletTable.java
示例5: SqlSpecialOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlSpecialOperator(
String name,
SqlKind kind,
int prec,
boolean leftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
prec,
leftAssoc,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlSpecialOperator.java
示例6: SqlSetOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlSetOperator(
String name,
SqlKind kind,
int prec,
boolean all,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
prec,
true,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
this.all = all;
}
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:SqlSetOperator.java
示例7: SqlInternalOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlInternalOperator(
String name,
SqlKind kind,
int prec,
boolean isLeftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
prec,
isLeftAssoc,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlInternalOperator.java
示例8: SqlPostfixOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlPostfixOperator(
String name,
SqlKind kind,
int prec,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
leftPrec(prec, true),
rightPrec(prec, true),
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:SqlPostfixOperator.java
示例9: SqlBinaryOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/**
* Creates a SqlBinaryOperator.
*
* @param name Name of operator
* @param kind Kind
* @param prec Precedence
* @param leftAssoc Left-associativity
* @param returnTypeInference Strategy to infer return type
* @param operandTypeInference Strategy to infer operand types
* @param operandTypeChecker Validator for operand types
*/
public SqlBinaryOperator(
String name,
SqlKind kind,
int prec,
boolean leftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
leftPrec(prec, leftAssoc),
rightPrec(prec, leftAssoc),
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:29,代码来源:SqlBinaryOperator.java
示例10: SqlInfixOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
protected SqlInfixOperator(
String[] names,
SqlKind kind,
int precedence,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
names[0],
kind,
precedence,
true,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
assert names.length > 1;
this.names = names;
}
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:SqlInfixOperator.java
示例11: SqlMonotonicBinaryOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlMonotonicBinaryOperator(
String name,
SqlKind kind,
int prec,
boolean isLeftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
prec,
isLeftAssoc,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlMonotonicBinaryOperator.java
示例12: SqlPrefixOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlPrefixOperator(
String name,
SqlKind kind,
int prec,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
leftPrec(prec, true),
rightPrec(prec, true),
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:SqlPrefixOperator.java
示例13: SqlAggFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/** Creates a built-in or user-defined SqlAggFunction or window function.
*
* <p>A user-defined function will have a value for {@code sqlIdentifier}; for
* a built-in function it will be null. */
protected SqlAggFunction(
String name,
SqlIdentifier sqlIdentifier,
SqlKind kind,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker,
SqlFunctionCategory funcType,
boolean requiresOrder,
boolean requiresOver) {
super(name, sqlIdentifier, kind, returnTypeInference, operandTypeInference,
operandTypeChecker, null, funcType);
this.requiresOrder = requiresOrder;
this.requiresOver = requiresOver;
}
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:SqlAggFunction.java
示例14: SqlFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/**
* Creates a new SqlFunction for a call to a builtin function.
*
* @param name Name of builtin function
* @param kind kind of operator implemented by function
* @param returnTypeInference strategy to use for return type inference
* @param operandTypeInference strategy to use for parameter type inference
* @param operandTypeChecker strategy to use for parameter type checking
* @param category categorization for function
*/
public SqlFunction(
String name,
SqlKind kind,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker,
SqlFunctionCategory category) {
// We leave sqlIdentifier as null to indicate
// that this is a builtin. Same for paramTypes.
this(name, null, kind, returnTypeInference, operandTypeInference,
operandTypeChecker, null, category);
assert !((category == SqlFunctionCategory.USER_DEFINED_CONSTRUCTOR)
&& (returnTypeInference == null));
}
开发者ID:apache,项目名称:calcite,代码行数:26,代码来源:SqlFunction.java
示例15: SqlOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/**
* Creates an operator.
*/
protected SqlOperator(
String name,
SqlKind kind,
int leftPrecedence,
int rightPrecedence,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
assert kind != null;
this.name = name;
this.kind = kind;
this.leftPrec = leftPrecedence;
this.rightPrec = rightPrecedence;
this.returnTypeInference = returnTypeInference;
this.operandTypeInference = operandTypeInference;
this.operandTypeChecker = operandTypeChecker;
}
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:SqlOperator.java
示例16: SqlFunctionalOperator
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlFunctionalOperator(
String name,
SqlKind kind,
int pred,
boolean isLeftAssoc,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker) {
super(
name,
kind,
pred,
isLeftAssoc,
returnTypeInference,
operandTypeInference,
operandTypeChecker);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:SqlFunctionalOperator.java
示例17: SqlUserDefinedAggFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public SqlUserDefinedAggFunction(SqlIdentifier opName,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker,
AggregateFunction function,
Boolean requestsOver) {
super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
returnTypeInference, operandTypeInference, operandTypeChecker,
SqlFunctionCategory.USER_DEFINED_FUNCTION, false, requestsOver);
this.function = function;
}
开发者ID:axbaretto,项目名称:flink,代码行数:12,代码来源:SqlUserDefinedAggFunction.java
示例18: SqlGroupFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/** Creates a SqlGroupFunction.
*
* @param name Function name
* @param kind Kind
* @param groupFunction Group function, if this is an auxiliary;
* null, if this is a group function
* @param operandTypeChecker Operand type checker
*/
public SqlGroupFunction(String name, SqlKind kind, SqlGroupFunction groupFunction,
SqlOperandTypeChecker operandTypeChecker) {
super(name, kind, ReturnTypes.ARG0, null,
operandTypeChecker, SqlFunctionCategory.SYSTEM);
this.groupFunction = groupFunction;
if (groupFunction != null) {
assert groupFunction.groupFunction == null;
}
}
开发者ID:axbaretto,项目名称:flink,代码行数:18,代码来源:SqlGroupFunction.java
示例19: convertDatetimeMinus
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
public RexNode convertDatetimeMinus(
SqlRexContext cx,
SqlDatetimeSubtractionOperator op,
SqlCall call) {
// Rewrite datetime minus
final RexBuilder rexBuilder = cx.getRexBuilder();
final List<SqlNode> operands = call.getOperandList();
final List<RexNode> exprs = convertExpressionList(cx, operands,
SqlOperandTypeChecker.Consistency.NONE);
RelDataType int8Type =
cx.getTypeFactory().createSqlType(SqlTypeName.BIGINT);
final RexNode[] casts = new RexNode[2];
casts[0] =
rexBuilder.makeCast(
cx.getTypeFactory().createTypeWithNullability(
int8Type,
exprs.get(0).getType().isNullable()),
exprs.get(0));
casts[1] =
rexBuilder.makeCast(
cx.getTypeFactory().createTypeWithNullability(
int8Type,
exprs.get(1).getType().isNullable()),
exprs.get(1));
final RelDataType resType =
cx.getValidator().getValidatedNodeType(call);
return rexBuilder.makeCall(resType, op, exprs.subList(0, 2));
}
开发者ID:apache,项目名称:calcite,代码行数:30,代码来源:StandardConvertletTable.java
示例20: SqlGroupedWindowFunction
import org.apache.calcite.sql.type.SqlOperandTypeChecker; //导入依赖的package包/类
/** Creates a SqlGroupedWindowFunction.
*
* @param name Function name
* @param kind Kind
* @param groupFunction Group function, if this is an auxiliary;
* null, if this is a group function
* @param returnTypeInference Strategy to use for return type inference
* @param operandTypeInference Strategy to use for parameter type inference
* @param operandTypeChecker Strategy to use for parameter type checking
* @param category Categorization for function
*/
public SqlGroupedWindowFunction(String name, SqlKind kind,
SqlGroupedWindowFunction groupFunction,
SqlReturnTypeInference returnTypeInference,
SqlOperandTypeInference operandTypeInference,
SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category) {
super(name, kind, returnTypeInference, operandTypeInference,
operandTypeChecker, category);
this.groupFunction = groupFunction;
Preconditions.checkArgument(groupFunction == null
|| groupFunction.groupFunction == null);
}
开发者ID:apache,项目名称:calcite,代码行数:23,代码来源:SqlGroupedWindowFunction.java
注:本文中的org.apache.calcite.sql.type.SqlOperandTypeChecker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论