org.apache.hadoop.hive.ql.exec
Class ExplainTask

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Task<ExplainWork>
      extended by org.apache.hadoop.hive.ql.exec.ExplainTask
All Implemented Interfaces:
Serializable, Node

public class ExplainTask
extends Task<ExplainWork>
implements Serializable

ExplainTask implementation.

See Also:
Serialized Form

Nested Class Summary
static class ExplainTask.MethodComparator
          MethodComparator.
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Task
Task.FeedType
 
Field Summary
static String EXPL_COLUMN_NAME
           
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Task
BACKUP_COMMON_JOIN, backupChildrenTasks, backupTask, childTasks, clonedConf, COMMON_JOIN, conf, console, CONVERTED_LOCAL_MAPJOIN, CONVERTED_MAPJOIN, db, driverContext, feedSubscribers, id, initialized, isdone, jobID, LOCAL_MAPJOIN, LOG, NO_TAG, parentTasks, queryPlan, queued, started, taskCounters, taskHandle, taskTag, work
 
Constructor Summary
ExplainTask()
           
 
Method Summary
 int execute(DriverContext driverContext)
          This method is overridden in each Task.
static org.json.JSONObject getJSONPlan(PrintStream out, ExplainWork work)
           
 String getName()
          Gets the name of the node.
 List<FieldSchema> getResultSchema()
           
 StageType getType()
          Should be overridden to return the type of the specific task among the types in StageType.
protected  void localizeMRTmpFilesImpl(Context ctx)
          If this task uses any map-reduce intermediate data (either for reading or for writing), localize them (using the supplied Context).
static String outputAST(String treeString, PrintStream out, boolean jsonOutput, int indent)
           
static org.json.JSONObject outputDependencies(PrintStream out, boolean jsonOutput, List<Task<? extends Serializable>> rootTasks, int indent)
           
static org.json.JSONObject outputStagePlans(PrintStream out, ExplainWork work, List<Task<? extends Serializable>> rootTasks, int indent)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Task
addDependentTask, cloneConf, done, executeTask, fetch, getAndInitBackupTask, getBackupChildrenTasks, getBackupTask, getChildren, getChildTasks, getCounters, getDependentTasks, getFeedSubscribers, getId, getInitialized, getJobID, getParentTasks, getQueryPlan, getQueued, getReducer, getTaskTag, getTopOperators, getWork, hasReduce, ifRetryCmdWhenFail, initialize, isLocalMode, isMapRedLocalTask, isMapRedTask, isRunnable, localizeMRTmpFiles, pushFeed, receiveFeed, removeDependentTask, removeFromChildrenTasks, requireLock, setBackupChildrenTasks, setBackupTask, setChildTasks, setDone, setFeedSubscribers, setId, setInitialized, setLocalMode, setParentTasks, setQueryPlan, setQueued, setRetryCmdWhenFail, setStarted, setTaskTag, setWork, started, subscribeFeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPL_COLUMN_NAME

public static final String EXPL_COLUMN_NAME
See Also:
Constant Field Values
Constructor Detail

ExplainTask

public ExplainTask()
Method Detail

getJSONPlan

public static org.json.JSONObject getJSONPlan(PrintStream out,
                                              ExplainWork work)
                                       throws Exception
Throws:
Exception

execute

public int execute(DriverContext driverContext)
Description copied from class: Task
This method is overridden in each Task. TODO execute should return a TaskHandle.

Specified by:
execute in class Task<ExplainWork>
Returns:
status of executing the task

outputAST

public static String outputAST(String treeString,
                               PrintStream out,
                               boolean jsonOutput,
                               int indent)
                        throws org.json.JSONException
Throws:
org.json.JSONException

outputDependencies

public static org.json.JSONObject outputDependencies(PrintStream out,
                                                     boolean jsonOutput,
                                                     List<Task<? extends Serializable>> rootTasks,
                                                     int indent)
                                              throws Exception
Throws:
Exception

outputStagePlans

public static org.json.JSONObject outputStagePlans(PrintStream out,
                                                   ExplainWork work,
                                                   List<Task<? extends Serializable>> rootTasks,
                                                   int indent)
                                            throws Exception
Throws:
Exception

getType

public StageType getType()
Description copied from class: Task
Should be overridden to return the type of the specific task among the types in StageType.

Specified by:
getType in class Task<ExplainWork>
Returns:
StageType.* or null if not overridden

getName

public String getName()
Description copied from interface: Node
Gets the name of the node. This is used in the rule dispatchers.

Specified by:
getName in interface Node
Returns:
String

localizeMRTmpFilesImpl

protected void localizeMRTmpFilesImpl(Context ctx)
Description copied from class: Task
If this task uses any map-reduce intermediate data (either for reading or for writing), localize them (using the supplied Context). Map-Reduce intermediate directories are allocated using Context.getMRTmpFileURI() and can be localized using localizeMRTmpFileURI(). This method is declared abstract to force any task code to explicitly deal with this aspect of execution.

Specified by:
localizeMRTmpFilesImpl in class Task<ExplainWork>
Parameters:
ctx - context object with which to localize

getResultSchema

public List<FieldSchema> getResultSchema()
Overrides:
getResultSchema in class Task<ExplainWork>


Copyright © 2013 The Apache Software Foundation