Package org.apache.hadoop.hive.serde2.objectinspector

Examples of org.apache.hadoop.hive.serde2.objectinspector.InspectableObject


    LinkedHashSet<Partition> unkn_parts = new LinkedHashSet<Partition>();

    try {
      StructObjectInspector rowObjectInspector = (StructObjectInspector)this.tab.getDeserializer().getObjectInspector();
      Object[] rowWithPart = new Object[2];
      InspectableObject inspectableObject = new InspectableObject();
    
      ExprNodeEvaluator evaluator = null;
      if (this.prunerExpr != null)
        evaluator = ExprNodeEvaluatorFactory.get(this.prunerExpr);
      for(Partition part: Hive.get().getPartitions(this.tab)) {
View Full Code Here


      typeInfos = new ArrayList<TypeInfo>();
      typeInfos.add(col1Type);
      typeInfos.add(colaType);
      dataType = TypeInfoFactory.getStructTypeInfo(names, typeInfos);
     
      r = new InspectableObject();
      r.o = data;
      r.oi = TypeInfoUtils.getStandardObjectInspectorFromTypeInfo(dataType);
    } catch (Throwable e) {
      e.printStackTrace();
      throw new RuntimeException (e);
View Full Code Here

      // get a evaluator for a simple field expression
      exprNodeDesc exprDesc = new exprNodeColumnDesc(colaType, "cola");
      ExprNodeEvaluator eval = ExprNodeEvaluatorFactory.get(exprDesc);

      // evaluate on row
      InspectableObject result = new InspectableObject();
      eval.evaluate(r.o, r.oi, result);
      assertEquals(result.o, cola);
      System.out.println("ExprNodeColumnEvaluator ok");
    } catch (Throwable e) {
      e.printStackTrace();
View Full Code Here

      exprNodeDesc cola0desc = new exprNodeIndexDesc(coladesc, new exprNodeConstantDesc(new Integer(0)));
      exprNodeDesc func1 = TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDesc("concat", col11desc, cola0desc);
      ExprNodeEvaluator eval = ExprNodeEvaluatorFactory.get(func1);

      // evaluate on row
      InspectableObject result = new InspectableObject();
      eval.evaluate(r.o, r.oi, result);
      assertEquals(result.o, "1a");
      System.out.println("ExprNodeFuncEvaluator ok");
    } catch (Throwable e) {
      e.printStackTrace();
View Full Code Here

      exprNodeDesc col11desc = new exprNodeIndexDesc(col1desc, new exprNodeConstantDesc(new Integer(1)));
      exprNodeDesc func1 = TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDesc(Double.class.getName(), col11desc);
      ExprNodeEvaluator eval = ExprNodeEvaluatorFactory.get(func1);

      // evaluate on row
      InspectableObject result = new InspectableObject();
      eval.evaluate(r.o, r.oi, result);
      assertEquals(result.o, Double.valueOf("1"));
      System.out.println("testExprNodeConversionEvaluator ok");
    } catch (Throwable e) {
      e.printStackTrace();
View Full Code Here

  }

  private static void measureSpeed(String expr, int times, ExprNodeEvaluator eval, InspectableObject input, Object standardOutput) throws HiveException {
    System.out.println("Evaluating " + expr + " for " + times + " times");
    // evaluate on row
    InspectableObject output = new InspectableObject();
    long start = System.currentTimeMillis();
    for (int i=0; i<times; i++) {
      eval.evaluate(input.o, input.oi, output);
      assertEquals(output.o, standardOutput);
    }
View Full Code Here

    }
    return statsDesc;
  }

  private int persistPartitionStats() throws HiveException {
    InspectableObject io = null;
    // Fetch result of the analyze table .. compute statistics for columns ..
    try {
      io = fetchColumnStats();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

    }
    return 0;
  }

  private int persistTableStats() throws HiveException {
    InspectableObject io = null;
    // Fetch result of the analyze table .. compute statistics for columns ..
    try {
      io = fetchColumnStats();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

    }
    return 1;
  }

  private InspectableObject fetchColumnStats() throws IOException, CommandNeedRetryException {
    InspectableObject io = null;

    try {
      int rowsRet = work.getLeastNumRows();
      if (rowsRet <= 0) {
        rowsRet = ColumnStatsWork.getLimit() >= 0 ?
View Full Code Here

  /**
   * Get the next row and push down it to operator tree.
   * Currently only used by FetchTask.
   **/
  public boolean pushRow() throws IOException, HiveException {
    InspectableObject row = getNextRow();
    if (row != null) {
      pushRow(row);
    } else {
      operator.flush();
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.objectinspector.InspectableObject

Copyright © 2018 www.massapicom. 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.