本文整理了Java中org.apache.calcite.linq4j.tree.BlockBuilder.add()
方法的一些代码示例,展示了BlockBuilder.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockBuilder.add()
方法的具体详情如下:
包路径:org.apache.calcite.linq4j.tree.BlockBuilder
类名称:BlockBuilder
方法名:add
BlockBuilder.add介绍
暂无
代码示例
代码示例来源:origin: apache/storm
Expressions.newArrayBounds(Object.class, 1,
Expressions.constant(1)));
builder.add(
Expressions.statement(
Expressions.call(
Expressions.parameter(ExecutableExpression.class, "this"),
StormBuiltInMethod.EXPR_EXECUTE2.method, context, values_)));
builder.add(
Expressions.return_(null,
Expressions.arrayIndex(values_, Expressions.constant(0))));
代码示例来源:origin: apache/storm
null, root, inputGetter, correlates);
for (int i = 0; i builder.add(
Expressions.statement(
Expressions.assign(
代码示例来源:origin: apache/kylin
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
final BlockBuilder builder = new BlockBuilder();
Expression uniOnExp= null;
for (Ord ord : Ord.zip(inputs)) {
EnumerableRel input = (EnumerableRel) ord.e;
final Result result = implementor.visitChild(this, ord.i, input, pref);
Expression childExp =
builder.append(
"child" + ord.i,
result.block);
if (uniOnExp== null) {
uniOnExp= childExp;
} else {
uniOnExp= createUnionExpression(unionExp, childExp, result.format == JavaRowFormat.ARRAY);
}
}
builder.add(unionExp);
final PhysType physType =
PhysTypeImpl.of(
implementor.getTypeFactory(),
getRowType(),
pref.prefer(JavaRowFormat.CUSTOM));
return implementor.result(physType, builder.toBlock());
}
}
代码示例来源:origin: Qihoo360/Quicksql
@Override public void implementNotNullAdd(WinAggContext info,
WinAggAddContext add) {
if (justFrameRowCount) {
return;
}
add.currentBlock().add(
Expressions.statement(
Expressions.postIncrementAssign(add.accumulator().get(0))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override public void implementNotNullAdd(AggContext info,
AggAddContext add) {
// acc[0].add(arg);
add.currentBlock().add(
Expressions.statement(
Expressions.call(add.accumulator().get(0),
BuiltInMethod.COLLECTION_ADD.method,
add.arguments().get(0))));
}
}
代码示例来源:origin: Qihoo360/Quicksql
@Override public void implementNotNullAdd(AggContext info,
AggAddContext add) {
add.currentBlock().add(
Expressions.statement(
Expressions.postIncrementAssign(add.accumulator().get(0))));
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override public void implementAdd(AggContext info, AggAddContext add) {
final SqlJsonObjectAggAggFunction function =
(SqlJsonObjectAggAggFunction) info.aggregation();
add.currentBlock().add(
Expressions.statement(
Expressions.call(m,
Iterables.concat(
Collections.singletonList(add.accumulator().get(0)),
add.arguments(),
Collections.singletonList(
Expressions.constant(function.getNullClause()))))));
}
代码示例来源:origin: Qihoo360/Quicksql
public void implementReset(AggContext info, AggResetContext reset) {
List acc = reset.accumulator();
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(acc.get(0), Expressions.constant(false))));
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(acc.get(1),
getDefaultValue(acc.get(1).getType()))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override public void implementAdd(AggContext info,
AggAddContext add) {
final SqlJsonArrayAggAggFunction function =
(SqlJsonArrayAggAggFunction) info.aggregation();
add.currentBlock().add(
Expressions.statement(
Expressions.call(m,
Iterables.concat(
Collections.singletonList(add.accumulator().get(0)),
add.arguments(),
Collections.singletonList(
Expressions.constant(function.getNullClause()))))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override public void implementReset(AggContext info,
AggResetContext reset) {
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(reset.accumulator().get(0),
Expressions.new_(HashMap.class))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override public void implementReset(AggContext info,
AggResetContext reset) {
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(reset.accumulator().get(0),
Expressions.new_(ArrayList.class))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Override protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
// acc[0] = new ArrayList();
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(reset.accumulator().get(0),
Expressions.new_(ArrayList.class))));
}
代码示例来源:origin: Qihoo360/Quicksql
@Override protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
// acc[0] = new ArrayList();
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(reset.accumulator().get(0),
Expressions.new_(ArrayList.class))));
}
代码示例来源:origin: Qihoo360/Quicksql
public final void implementReset(AggContext info, AggResetContext reset) {
if (trackNullsPerRow) {
List acc = reset.accumulator();
Expression flag = acc.get(acc.size() - 1);
BlockBuilder block = reset.currentBlock();
block.add(
Expressions.statement(
Expressions.assign(flag,
RexImpTable.getDefaultValue(flag.getType()))));
}
implementNotNullReset(info, reset);
}
代码示例来源:origin: Qihoo360/Quicksql
protected final void accAdvance(AggAddContext add, Expression acc,
Expression next) {
add.currentBlock().add(
Expressions.statement(
Expressions.assign(acc, Types.castIfNecessary(acc.type, next))));
}
代码示例来源:origin: org.apache.calcite/calcite-core
protected final void accAdvance(AggAddContext add, Expression acc,
Expression next) {
add.currentBlock().add(
Expressions.statement(
Expressions.assign(acc, Types.castIfNecessary(acc.type, next))));
}
代码示例来源:origin: Qihoo360/Quicksql
@Override protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
Expression start = info.returnType() == BigDecimal.class
? Expressions.constant(BigDecimal.ZERO)
: Expressions.constant(0);
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(reset.accumulator().get(0), start)));
}
代码示例来源:origin: Qihoo360/Quicksql
protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
BlockBuilder block = reset.currentBlock();
List accumulator = reset.accumulator();
for (int i = 0; i Expression exp = accumulator.get(i);
block.add(
Expressions.statement(
Expressions.assign(exp,
RexImpTable.getDefaultValue(exp.getType()))));
}
}
代码示例来源:origin: org.apache.calcite/calcite-core
protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
BlockBuilder block = reset.currentBlock();
List accumulator = reset.accumulator();
for (int i = 0; i Expression exp = accumulator.get(i);
block.add(
Expressions.statement(
Expressions.assign(exp,
RexImpTable.getDefaultValue(exp.getType()))));
}
}
代码示例来源:origin: Qihoo360/Quicksql
@Override protected void implementNotNullReset(AggContext info,
AggResetContext reset) {
Expression acc = reset.accumulator().get(0);
Primitive p = Primitive.of(acc.getType());
boolean isMin = MIN == info.aggregation();
Object inf = p == null ? null : (isMin ? p.max : p.min);
reset.currentBlock().add(
Expressions.statement(
Expressions.assign(acc,
Expressions.constant(inf, acc.getType()))));
}