本文整理匯總了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;
}