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