当前位置: 首页>>代码示例>>Java>>正文


Java ValueExpressions.BooleanExpression方法代码示例

本文整理汇总了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);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:InterpreterEvaluator.java

示例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;
  }

}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:47,代码来源:TestOpSerialization.java

示例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;
  }

}
 
开发者ID:axbaretto,项目名称:drill,代码行数:42,代码来源:TestOpSerialization.java


注:本文中的org.apache.drill.common.expression.ValueExpressions.BooleanExpression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。