Examples of PTFExpressionDef


Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

    return pDef;
  }

  private PTFExpressionDef translate(ShapeDetails inpShape,
      PartitionExpression pExpr) throws SemanticException {
    PTFExpressionDef expDef = null;
    try {
      expDef = buildExpressionDef(inpShape, pExpr.getExpression());
    } catch (HiveException he) {
      throw new SemanticException(he);
    }
    PTFTranslator.validateComparable(expDef.getOI(),
        String.format("Partition Expression %s is not a comparable expression", pExpr
            .getExpression().toStringTree()));
    return expDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

      OrderExpression oExpr)
      throws SemanticException {
    OrderExpressionDef oexpDef = new OrderExpressionDef();
    oexpDef.setOrder(oExpr.getOrder());
    try {
      PTFExpressionDef expDef = buildExpressionDef(inpShape, oExpr.getExpression());
      oexpDef.setExpressionTreeString(expDef.getExpressionTreeString());
      oexpDef.setExprEvaluator(expDef.getExprEvaluator());
      oexpDef.setExprNode(expDef.getExprNode());
      oexpDef.setOI(expDef.getOI());
    } catch (HiveException he) {
      throw new SemanticException(he);
    }
    PTFTranslator.validateComparable(oexpDef.getOI(),
        String.format("Partition Expression %s is not a comparable expression",
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

      ValueBoundarySpec vBndSpec = (ValueBoundarySpec) bndSpec;
      ValueBoundaryDef vbDef = new ValueBoundaryDef();
      vbDef.setAmt(vBndSpec.getAmt());
      vbDef.setDirection(vBndSpec.getDirection());
      PTFTranslator.validateNoLeadLagInValueBoundarySpec(vBndSpec.getExpression());
      PTFExpressionDef exprDef = null;
      try {
        exprDef = buildExpressionDef(inpShape, vBndSpec.getExpression());
      } catch (HiveException he) {
        throw new SemanticException(he);
      }
      PTFTranslator.validateValueBoundaryExprType(exprDef.getOI());
      vbDef.setExpressionDef(exprDef);
      return vbDef;
    }
    else if (bndSpec instanceof RangeBoundarySpec) {
      RangeBoundarySpec rBndSpec = (RangeBoundarySpec) bndSpec;
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

  /*
   * Expr translation helper methods
   */
  public PTFExpressionDef buildExpressionDef(ShapeDetails inpShape, ASTNode arg)
      throws HiveException {
    PTFExpressionDef argDef = new PTFExpressionDef();

    ExprNodeDesc exprNode = semAly.genExprNodeDesc(arg, inpShape.getRr(),
        inpShape.getTypeCheckCtx());
    ExprNodeEvaluator exprEval = WindowingExprNodeEvaluatorFactory.get(llInfo, exprNode);
    ObjectInspector oi = initExprNodeEvaluator(exprEval, exprNode, inpShape);

    argDef.setExpressionTreeString(arg.toStringTree());
    argDef.setExprNode(exprNode);
    argDef.setExprEvaluator(exprEval);
    argDef.setOI(oi);
    return argDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

    List<ASTNode> args = spec.getArgs();
    if (args != null)
    {
      for (ASTNode expr : args)
      {
        PTFExpressionDef argDef = null;
        try {
          argDef = buildExpressionDef(inpDef.getOutputShape(), expr);
        } catch (HiveException he) {
          throw new SemanticException(he);
        }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

    ArrayList<ASTNode> args = spec.getArgs();
    if (args != null)
    {
      for (ASTNode expr : args)
      {
        PTFExpressionDef argDef = null;
        try {
          argDef = buildExpressionDef(inpShape, expr);
        } catch (HiveException he) {
          throw new SemanticException(he);
        }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

      return null;
    }

    PartitionDef pDef = new PartitionDef();
    for (PartitionExpression pExpr : spec.getExpressions()) {
      PTFExpressionDef expDef = translate(inpShape, pExpr);
      pDef.addExpression(expDef);
    }
    return pDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

    return pDef;
  }

  private PTFExpressionDef translate(ShapeDetails inpShape,
      PartitionExpression pExpr) throws SemanticException {
    PTFExpressionDef expDef = null;
    try {
      expDef = buildExpressionDef(inpShape, pExpr.getExpression());
    } catch (HiveException he) {
      throw new SemanticException(he);
    }
    PTFTranslator.validateComparable(expDef.getOI(),
        String.format("Partition Expression %s is not a comparable expression", pExpr
            .getExpression().toStringTree()));
    return expDef;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

      OrderExpression oExpr)
      throws SemanticException {
    OrderExpressionDef oexpDef = new OrderExpressionDef();
    oexpDef.setOrder(oExpr.getOrder());
    try {
      PTFExpressionDef expDef = buildExpressionDef(inpShape, oExpr.getExpression());
      oexpDef.setExpressionTreeString(expDef.getExpressionTreeString());
      oexpDef.setExprEvaluator(expDef.getExprEvaluator());
      oexpDef.setExprNode(expDef.getExprNode());
      oexpDef.setOI(expDef.getOI());
    } catch (HiveException he) {
      throw new SemanticException(he);
    }
    PTFTranslator.validateComparable(oexpDef.getOI(),
        String.format("Partition Expression %s is not a comparable expression",
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.ptf.PTFExpressionDef

      ValueBoundarySpec vBndSpec = (ValueBoundarySpec) bndSpec;
      ValueBoundaryDef vbDef = new ValueBoundaryDef();
      vbDef.setAmt(vBndSpec.getAmt());
      vbDef.setDirection(vBndSpec.getDirection());
      PTFTranslator.validateNoLeadLagInValueBoundarySpec(vBndSpec.getExpression());
      PTFExpressionDef exprDef = null;
      try {
        exprDef = buildExpressionDef(inpShape, vBndSpec.getExpression());
      } catch (HiveException he) {
        throw new SemanticException(he);
      }
      PTFTranslator.validateValueBoundaryExprType(exprDef.getOI());
      vbDef.setExpressionDef(exprDef);
      return vbDef;
    }
    else if (bndSpec instanceof RangeBoundarySpec) {
      RangeBoundarySpec rBndSpec = (RangeBoundarySpec) bndSpec;
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.