本文整理汇总了Java中org.apache.drill.common.expression.ValueExpressions.IntExpression方法的典型用法代码示例。如果您正苦于以下问题:Java ValueExpressions.IntExpression方法的具体用法?Java ValueExpressions.IntExpression怎么用?Java ValueExpressions.IntExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.drill.common.expression.ValueExpressions
的用法示例。
在下文中一共展示了ValueExpressions.IntExpression方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: numTilesFromExpression
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
private int numTilesFromExpression(LogicalExpression numTilesExpr) {
if ((numTilesExpr instanceof ValueExpressions.IntExpression)) {
int nt = ((ValueExpressions.IntExpression) numTilesExpr).getInt();
if (nt > 0) {
return nt;
}
}
throw UserException.functionError().message("NTILE only accepts positive integer argument").build(logger);
}
示例2: getType
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
/**
* Defines function return type and sets precision if it pad length parameter is int expression.
* If pad length is less than zero, return type precision is 0.
*
* @param logicalExpressions logical expressions
* @param attributes function attributes
* @return return type
*/
@Override
public TypeProtos.MajorType getType(List<LogicalExpression> logicalExpressions, FunctionAttributes attributes) {
TypeProtos.MajorType.Builder builder = TypeProtos.MajorType.newBuilder()
.setMinorType(attributes.getReturnValue().getType().getMinorType())
.setMode(FunctionUtils.getReturnTypeDataMode(logicalExpressions, attributes));
if (logicalExpressions.get(1).iterator().hasNext() &&
logicalExpressions.get(1).iterator().next() instanceof ValueExpressions.IntExpression) {
int precision = ((ValueExpressions.IntExpression) logicalExpressions.get(1).iterator().next()).getInt();
// if pad length is less than zero, output length is 0
builder.setPrecision(Math.max(precision, 0));
}
return builder.build();
}
示例3: visitIntConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public Boolean visitIntConstant(ValueExpressions.IntExpression intExpr, IdentityHashMap<LogicalExpression, Object> value) throws RuntimeException {
return true;
}
示例4: visitIntConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public ValueHolder visitIntConstant(ValueExpressions.IntExpression e, Integer inIndex) throws RuntimeException {
return ValueHolderHelper.getIntHolder(e.getInt());
}
示例5: visitIntConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public Void visitIntConstant(ValueExpressions.IntExpression intExpr, ErrorCollector value) throws RuntimeException {
return null;
}
示例6: visitIntConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public Statistics visitIntConstant(ValueExpressions.IntExpression expr, Void value) throws RuntimeException {
return getStatistics(expr.getInt());
}
示例7: visitIntConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public LogicalExpression visitIntConstant(ValueExpressions.IntExpression intExpr, Set<LogicalExpression> value)
throws RuntimeException {
return intExpr;
}