public class Driver extends Object implements CommandProcessor
Modifier and Type | Class and Description |
---|---|
static class |
Driver.DriverState |
static class |
Driver.LockedDriverState |
Constructor and Description |
---|
Driver() |
Driver(HiveConf conf) |
Driver(HiveConf conf,
Context ctx) |
Driver(HiveConf conf,
String userName) |
Driver(QueryState queryState,
String userName) |
Modifier and Type | Method and Description |
---|---|
int |
close() |
int |
compile(String command)
Compile a new query.
|
int |
compile(String command,
boolean resetTaskIds)
Compile a new query, but potentially reset taskID counter.
|
int |
compile(String command,
boolean resetTaskIds,
boolean deferClose) |
CommandProcessorResponse |
compileAndRespond(String command) |
void |
destroy() |
static void |
doAuthorization(HiveOperation op,
BaseSemanticAnalyzer sem,
String command)
Do authorization using post semantic analysis information in the semantic analyzer
The original command is also passed so that authorization interface can provide
more useful information in logs.
|
int |
execute() |
int |
execute(boolean deferClose) |
org.apache.hadoop.mapred.ClusterStatus |
getClusterStatus()
Return the status information about the Map-Reduce cluster
|
String |
getErrorMsg() |
FetchTask |
getFetchTask() |
int |
getMaxRows()
Return the maximum number of rows returned by getResults
|
QueryPlan |
getPlan() |
QueryDisplay |
getQueryDisplay() |
Query |
getQueryPlan() |
boolean |
getResults(List res) |
Schema |
getSchema() |
Schema |
getThriftSchema()
Get a Schema with fields represented with Thrift DDL types
|
int |
getTryCount() |
void |
init() |
boolean |
isFetchingTable() |
void |
resetFetch() |
void |
resetQueryState()
Resets QueryState to get new queryId on Driver reuse.
|
CommandProcessorResponse |
run() |
CommandProcessorResponse |
run(String command) |
CommandProcessorResponse |
run(String command,
boolean alreadyCompiled) |
void |
setMaxRows(int maxRows)
Set the maximum number of rows returned by getResults
|
void |
setOperationId(String opId)
Set the HS2 operation handle's guid string
|
void |
setTryCount(int tryCount) |
public Driver()
public Driver(HiveConf conf)
public Driver(QueryState queryState, String userName)
public void init()
init
in interface CommandProcessor
public org.apache.hadoop.mapred.ClusterStatus getClusterStatus() throws Exception
Exception
public Schema getSchema()
public Schema getThriftSchema() throws Exception
Exception
public int getMaxRows()
public void setMaxRows(int maxRows)
public int compile(String command)
command
- The SQL query to compile.public int compile(String command, boolean resetTaskIds)
command
- The HiveQL query to compileresetTaskIds
- Resets taskID counter if true.public int compile(String command, boolean resetTaskIds, boolean deferClose)
public static void doAuthorization(HiveOperation op, BaseSemanticAnalyzer sem, String command) throws HiveException, AuthorizationException
sem
- SemanticAnalyzer used to parse input querycommand
- input queryHiveException
AuthorizationException
public QueryPlan getPlan()
public FetchTask getFetchTask()
public CommandProcessorResponse run(String command) throws CommandNeedRetryException
run
in interface CommandProcessor
CommandNeedRetryException
public CommandProcessorResponse run() throws CommandNeedRetryException
CommandNeedRetryException
public CommandProcessorResponse run(String command, boolean alreadyCompiled) throws CommandNeedRetryException
CommandNeedRetryException
public CommandProcessorResponse compileAndRespond(String command)
public int execute() throws CommandNeedRetryException
CommandNeedRetryException
public int execute(boolean deferClose) throws CommandNeedRetryException
CommandNeedRetryException
public boolean isFetchingTable()
public boolean getResults(List res) throws IOException, CommandNeedRetryException
IOException
CommandNeedRetryException
public void resetFetch() throws IOException
IOException
public int getTryCount()
public void setTryCount(int tryCount)
public int close()
public void destroy()
public Query getQueryPlan() throws IOException
IOException
public String getErrorMsg()
public QueryDisplay getQueryDisplay()
public void setOperationId(String opId)
opId
- base64 encoded guid stringpublic void resetQueryState()
Copyright © 2021 The Apache Software Foundation. All rights reserved.