Examples of InspectableObject


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

 
        boolean ret = currRecReader.next(key, value);
        if (ret) {
          if (tblDataDone) {
            Object obj = serde.deserialize(value);
            return new InspectableObject(obj, serde.getObjectInspector());
          } else {
            rowWithPart[0] = serde.deserialize(value);
            return new InspectableObject(rowWithPart, rowObjectInspector);
          }
        } else {
          currRecReader.close();
          currRecReader = null;
        }
View Full Code Here

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

      ArrayList<String> data = new ArrayList<String> ();
      data.add(""+i);
      data.add(""+(i+1));
      data.add(""+(i+2));
      try {
        r[i] = new InspectableObject();
        r[i].o = data;
        r[i].oi = ObjectInspectorFactory.getStandardStructObjectInspector(names, objectInspectors);
      } catch (Throwable e) {
        throw new RuntimeException (e);
      }
View Full Code Here

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

      for(int i=0; i<5; i++) {
        op.process(r[i].o, 0);
      }
      op.close(false);

      InspectableObject io = new InspectableObject();
      for(int i=0; i<5; i++) {
        cdop.retrieve(io);
        System.out.println("[" + i + "] io.o=" + io.o);
        System.out.println("[" + i + "] io.oi=" + io.oi);
        StructObjectInspector soi = (StructObjectInspector)io.oi;
View Full Code Here

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

      // get map operator and initialize it
      MapOperator mo = new MapOperator();
      mo.initializeAsRoot(hconf, mrwork);

      Text tw = new Text();
      InspectableObject io1 = new InspectableObject();
      InspectableObject io2 = new InspectableObject();
      for(int i=0; i<5; i++) {
        String answer = "[[" + i + ", " + (i+1) + ", " + (i+2) + "]]";

        tw.set("" + i + "\u0001" + (i+1) + "\u0001"+ (i+2));
        mo.process((Writable)tw);
View Full Code Here

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

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

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

  }

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

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

  /**
   * 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) {
      operator.process(row.o, 0);
    }
    return row != null;
  }
View Full Code Here

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

    }
    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

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

    }
    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

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

    return 1;
  }

  private InspectableObject fetchColumnStats() throws IOException, CommandNeedRetryException {
    try {
      InspectableObject io = ftOp.getNextRow();
      if (io == null) {
        throw new CommandNeedRetryException();
      }
      return io;
    } catch (CommandNeedRetryException e) {
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.