本文整理汇总了Java中org.apache.drill.common.expression.ValueExpressions.BooleanExpression方法的典型用法代码示例。如果您正苦于以下问题:Java ValueExpressions.BooleanExpression方法的具体用法?Java ValueExpressions.BooleanExpression怎么用?Java ValueExpressions.BooleanExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.drill.common.expression.ValueExpressions
的用法示例。
在下文中一共展示了ValueExpressions.BooleanExpression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitBooleanConstant
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Override
public ValueHolder visitBooleanConstant(ValueExpressions.BooleanExpression e,Integer value) throws RuntimeException {
return ValueHolderHelper.getBitHolder(e.getBoolean() == false ? 0 : 1);
}
示例2: testSerializedDeserialize
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Test
public void testSerializedDeserialize() throws Throwable {
DrillConfig c = DrillConfig.create();
PhysicalPlanReader reader = new PhysicalPlanReader(c, c.getMapper(), CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
MockSubScanPOP s = new MockSubScanPOP("abc", null);
s.setOperatorId(3);
Filter f = new Filter(s, new ValueExpressions.BooleanExpression("true", ExpressionPosition.UNKNOWN), 0.1f);
f.setOperatorId(2);
UnionExchange e = new UnionExchange(f);
e.setOperatorId(1);
Screen screen = new Screen(e, CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
screen.setOperatorId(0);
boolean reversed = false;
while (true) {
List<PhysicalOperator> pops = Lists.newArrayList();
pops.add(s);
pops.add(e);
pops.add(f);
pops.add(screen);
if (reversed) {
pops = Lists.reverse(pops);
}
PhysicalPlan plan1 = new PhysicalPlan(PlanProperties.builder().build(), pops);
String json = plan1.unparse(c.getMapper().writer());
System.out.println(json);
PhysicalPlan plan2 = reader.readPhysicalPlan(json);
System.out.println("++++++++");
System.out.println(plan2.unparse(c.getMapper().writer()));
PhysicalOperator root = plan2.getSortedOperators(false).iterator().next();
assertEquals(0, root.getOperatorId());
PhysicalOperator o1 = root.iterator().next();
assertEquals(1, o1.getOperatorId());
PhysicalOperator o2 = o1.iterator().next();
assertEquals(2, o2.getOperatorId());
if(reversed) {
break;
}
reversed = !reversed;
}
}
示例3: testSerializedDeserialize
import org.apache.drill.common.expression.ValueExpressions; //导入方法依赖的package包/类
@Test
public void testSerializedDeserialize() throws Throwable {
MockSubScanPOP s = new MockSubScanPOP("abc", false, null);
s.setOperatorId(3);
Filter f = new Filter(s, new ValueExpressions.BooleanExpression("true", ExpressionPosition.UNKNOWN), 0.1f);
f.setOperatorId(2);
UnionExchange e = new UnionExchange(f);
e.setOperatorId(1);
Screen screen = new Screen(e, CoordinationProtos.DrillbitEndpoint.getDefaultInstance());
screen.setOperatorId(0);
boolean reversed = false;
while (true) {
List<PhysicalOperator> pops = Lists.newArrayList();
pops.add(s);
pops.add(e);
pops.add(f);
pops.add(screen);
if (reversed) {
pops = Lists.reverse(pops);
}
PhysicalPlan plan1 = new PhysicalPlan(PlanProperties.builder().build(), pops);
String json = plan1.unparse(writer);
PhysicalPlan plan2 = reader.readPhysicalPlan(json);
PhysicalOperator root = plan2.getSortedOperators(false).iterator().next();
assertEquals(0, root.getOperatorId());
PhysicalOperator o1 = root.iterator().next();
assertEquals(1, o1.getOperatorId());
PhysicalOperator o2 = o1.iterator().next();
assertEquals(2, o2.getOperatorId());
if(reversed) {
break;
}
reversed = !reversed;
}
}