當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。