Package org.apache.hadoop.hive.ql.exec

Examples of org.apache.hadoop.hive.ql.exec.ExplainTask


              return; // ignore client only queries
            }

            switch(hookContext.getHookType()) {
            case PRE_EXEC_HOOK:
              ExplainTask explain = new ExplainTask();
              explain.initialize(conf, plan, null);
              String query = plan.getQueryStr();
              List<Task<?>> rootTasks = plan.getRootTasks();
              JSONObject explainPlan = explain.getJSONPlan(null, null, rootTasks,
                   plan.getFetchTask(), true, false, false);
              fireAndForget(conf, createPreHookEvent(queryId, query,
                   explainPlan, queryStartTime, user, numMrJobs, numTezJobs));
              break;
            case POST_EXEC_HOOK:
View Full Code Here


   * @throws java.io.IOException
   */
  private String getExplainOutput(BaseSemanticAnalyzer sem, QueryPlan plan,
      String astStringTree) throws IOException {
    String ret = null;
    ExplainTask task = new ExplainTask();
    task.initialize(conf, plan, null);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(baos);
    try {
      task.getJSONPlan(ps, astStringTree, sem.getRootTasks(), sem.getFetchTask(),
          false, true, true);
      ret = baos.toString();
    } catch (Exception e) {
      LOG.warn("Exception generating explain output: " + e, e);
    }
View Full Code Here

        authorize);

    work.setAppendTaskType(
        HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVEEXPLAINDEPENDENCYAPPENDTASKTYPES));

    ExplainTask explTask = (ExplainTask) TaskFactory.get(work, conf);

    fieldList = explTask.getResultSchema();
    rootTasks.add(explTask);
  }
View Full Code Here

    Path tmp = new Path(f.getPath());
    fs.create(tmp);
    fs.deleteOnExit(tmp);
    ExplainWork work = new ExplainWork(tmp, sem.getParseContext(), sem.getRootTasks(),
        sem.getFetchTask(), astStringTree, sem, true, false, false, false, false);
    ExplainTask task = new ExplainTask();
    task.setWork(work);
    task.initialize(conf, plan, null);
    task.execute(null);
    FSDataInputStream in = fs.open(tmp);
    StringBuilder builder = new StringBuilder();
    final int bufSz = 4096;
    byte[] buf = new byte[bufSz];
    long pos = 0L;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.exec.ExplainTask

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.