Examples of HoldingContainer


Examples of org.apache.drill.exec.expr.ClassGenerator.HoldingContainer

      JType holderType = generator.getHolderType(majorType);
      JVar var = generator.declareClassField("dec38", holderType);
      JExpression stringLiteral = JExpr.lit(e.getBigDecimal().toString());
      setup.assign(var,
          generator.getModel().ref(ValueHolderHelper.class).staticInvoke("getVarCharHolder").arg(stringLiteral));
      return new HoldingContainer(majorType, var, null, null);
    }
View Full Code Here

Examples of org.apache.drill.exec.expr.ClassGenerator.HoldingContainer

    }
   
    private HoldingContainer visitBooleanAnd(BooleanOperator op,
        ClassGenerator<?> generator) {
     
      HoldingContainer out = generator.declare(op.getMajorType());
     
      JLabel label = generator.getEvalBlockLabel("AndOP");
      JBlock eval = generator.getEvalBlock().block()// enter into nested block
      generator.nestEvalBlock(eval);

      HoldingContainer arg = null;
     
      JExpression e = null;
     
      //  value of boolean "and" when one side is null
      //    p       q     p and q
      //    true    null     null
      //    false   null     false
      //    null    true     null
      //    null    false    false
      //    null    null     null
      for (int i = 0; i < op.args.size(); i++) {
        arg = op.args.get(i).accept(this, generator);
       
        JBlock earlyExit = null;
        if (arg.isOptional()) {
          earlyExit = eval._if(arg.getIsSet().eq(JExpr.lit(1)).cand(arg.getValue().ne(JExpr.lit(1))))._then();         
          if(e == null){
            e = arg.getIsSet();
          }else{
            e = e.mul(arg.getIsSet());
          }           
        } else {
          earlyExit = eval._if(arg.getValue().ne(JExpr.lit(1)))._then();              
        }
       
        if (out.isOptional()) {
          earlyExit.assign(out.getIsSet(), JExpr.lit(1));
        }
View Full Code Here

Examples of org.apache.drill.exec.expr.ClassGenerator.HoldingContainer

    @Override
    public HoldingContainer visitFunctionHolderExpression(FunctionHolderExpression e, ClassGenerator<?> generator)
        throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitFunctionHolderExpression(e, generator);
        // generator.getMappingSet().exitConstant();
        // return c;
        return renderConstantExpression(generator, c);
      } else if (generator.getMappingSet().isWithinConstant()) {
        return super.visitFunctionHolderExpression(e, generator).setConstant(true);
View Full Code Here

Examples of org.apache.drill.exec.expr.ClassGenerator.HoldingContainer

    @Override
    public HoldingContainer visitBooleanOperator(BooleanOperator e, ClassGenerator<?> generator)
        throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitBooleanOperator(e, generator);
        return renderConstantExpression(generator, c);
      } else if (generator.getMappingSet().isWithinConstant()) {
        return super.visitBooleanOperator(e, generator).setConstant(true);
      } else {
        return super.visitBooleanOperator(e, generator);
View Full Code Here

Examples of org.apache.drill.exec.expr.ClassGenerator.HoldingContainer

    }
    @Override
    public HoldingContainer visitIfExpression(IfExpression e, ClassGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitIfExpression(e, generator);
        // generator.getMappingSet().exitConstant();
        // return c;
        return renderConstantExpression(generator, c);
      } else if (generator.getMappingSet().isWithinConstant()) {
        return super.visitIfExpression(e, generator).setConstant(true);
View Full Code Here

Examples of org.apache.drill.exec.expr.CodeGenerator.HoldingContainer

    @Override
    public HoldingContainer visitFunctionCall(FunctionCall e, CodeGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitFunctionCall(e, generator);
        generator.getMappingSet().exitConstant();
        return c;
      } else {
        return super.visitFunctionCall(e, generator);
      }
View Full Code Here

Examples of org.apache.drill.exec.expr.CodeGenerator.HoldingContainer

    @Override
    public HoldingContainer visitIfExpression(IfExpression e, CodeGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitIfExpression(e, generator);
        generator.getMappingSet().exitConstant();
        return c;
      } else {
        return super.visitIfExpression(e, generator);
      }
View Full Code Here

Examples of org.apache.drill.exec.expr.CodeGenerator.HoldingContainer

    @Override
    public HoldingContainer visitSchemaPath(SchemaPath e, CodeGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitSchemaPath(e, generator);
        generator.getMappingSet().exitConstant();
        return c;
      } else {
        return super.visitSchemaPath(e, generator);
      }
View Full Code Here

Examples of org.apache.drill.exec.expr.CodeGenerator.HoldingContainer

    @Override
    public HoldingContainer visitLongConstant(LongExpression e, CodeGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitLongConstant(e, generator);
        generator.getMappingSet().exitConstant();
        return c;
      } else {
        return super.visitLongConstant(e, generator);
      }
View Full Code Here

Examples of org.apache.drill.exec.expr.CodeGenerator.HoldingContainer

    @Override
    public HoldingContainer visitDoubleConstant(DoubleExpression e, CodeGenerator<?> generator) throws RuntimeException {
      if (constantBoundaries.contains(e)) {
        generator.getMappingSet().enterConstant();
        HoldingContainer c = super.visitDoubleConstant(e, generator);
        generator.getMappingSet().exitConstant();
        return c;
      } else {
        return super.visitDoubleConstant(e, generator);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.