public class Driver extends Object implements IDriver
Modifier and Type | Class and Description |
---|---|
static class |
Driver.LockedDriverState |
Constructor and Description |
---|
Driver(HiveConf conf) |
Driver(HiveConf conf,
Context ctx,
LineageState lineageState) |
Driver(HiveConf conf,
LineageState lineageState) |
Driver(HiveConf conf,
String userName,
LineageState lineageState) |
Driver(QueryState queryState,
String userName) |
Driver(QueryState queryState,
String userName,
QueryInfo queryInfo) |
Driver(QueryState queryState,
String userName,
QueryInfo queryInfo,
HiveTxnManager txnMgr) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
compile(String command)
Compile a new query.
|
int |
compile(String command,
boolean resetTaskIds)
Compile a new query, but potentially reset taskID counter.
|
CommandProcessorResponse |
compileAndRespond(String command) |
CommandProcessorResponse |
compileAndRespond(String command,
boolean cleanupTxnList) |
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.
|
org.apache.hadoop.mapred.ClusterStatus |
getClusterStatus()
Return the status information about the Map-Reduce cluster
|
HiveConf |
getConf() |
Context |
getContext() |
String |
getErrorMsg() |
Schema |
getExplainSchema() |
FetchTask |
getFetchTask() |
HookRunner |
getHookRunner() |
int |
getMaxRows()
Return the maximum number of rows returned by getResults
|
QueryPlan |
getPlan() |
PlanMapper |
getPlanMapper() |
QueryDisplay |
getQueryDisplay() |
Query |
getQueryPlan() |
QueryState |
getQueryState() |
boolean |
getResults(List res) |
Schema |
getSchema() |
StatsSource |
getStatsSource() |
Schema |
getThriftSchema()
Get a Schema with fields represented with Thrift DDL types
|
boolean |
hasResultSet() |
boolean |
isFetchingTable() |
void |
lockAndRespond() |
void |
releaseLocksAndCommitOrRollback(boolean commit) |
void |
releaseLocksAndCommitOrRollback(boolean commit,
HiveTxnManager txnManager) |
void |
releaseResources()
Release some resources after a query is executed
while keeping the result around.
|
void |
resetFetch() |
CommandProcessorResponse |
run() |
CommandProcessorResponse |
run(String command) |
CommandProcessorResponse |
run(String command,
boolean alreadyCompiled) |
void |
setCompactionWriteIds(org.apache.hadoop.hive.common.ValidWriteIdList val) |
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 |
setStatsSource(StatsSource runtimeStatsSource) |
public Driver(HiveConf conf)
public Driver(HiveConf conf, LineageState lineageState)
public Driver(HiveConf conf, Context ctx, LineageState lineageState)
public Driver(HiveConf conf, String userName, LineageState lineageState)
public Driver(QueryState queryState, String userName)
public Driver(QueryState queryState, String userName, QueryInfo queryInfo)
public Driver(QueryState queryState, String userName, QueryInfo queryInfo, HiveTxnManager txnMgr)
public org.apache.hadoop.mapred.ClusterStatus getClusterStatus() throws Exception
Exception
public Schema getExplainSchema()
public Context getContext()
getContext
in interface IDriver
public PlanMapper getPlanMapper()
public Schema getThriftSchema() throws Exception
Exception
public int getMaxRows()
public void setMaxRows(int maxRows)
setMaxRows
in interface IDriver
public int compile(String command)
public int compile(String command, boolean resetTaskIds)
command
- The HiveQL query to compileresetTaskIds
- Resets taskID counter if true.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()
getFetchTask
in interface IDriver
public void releaseLocksAndCommitOrRollback(boolean commit) throws LockException
LockException
public void releaseLocksAndCommitOrRollback(boolean commit, HiveTxnManager txnManager) throws LockException
commit
- if there is an open transaction and if true, commit,
if false rollback. If there is no open transaction this parameter is ignored.txnManager
- an optional existing transaction manager retrieved earlier from the sessionLockException
public void releaseResources()
public CommandProcessorResponse run(String command)
run
in interface IDriver
run
in interface CommandProcessor
public CommandProcessorResponse run()
public CommandProcessorResponse run(String command, boolean alreadyCompiled)
public CommandProcessorResponse compileAndRespond(String command)
compileAndRespond
in interface IDriver
public CommandProcessorResponse compileAndRespond(String command, boolean cleanupTxnList)
public void lockAndRespond() throws CommandProcessorResponse
CommandProcessorResponse
public boolean isFetchingTable()
isFetchingTable
in interface IDriver
public boolean getResults(List res) throws IOException
getResults
in interface IDriver
IOException
public void resetFetch() throws IOException
resetFetch
in interface IDriver
IOException
public void close()
close
in interface AutoCloseable
close
in interface IDriver
public Query getQueryPlan() throws IOException
IOException
public String getErrorMsg()
public QueryDisplay getQueryDisplay()
getQueryDisplay
in interface IDriver
public void setOperationId(String opId)
setOperationId
in interface IDriver
opId
- base64 encoded guid stringpublic QueryState getQueryState()
public HookRunner getHookRunner()
public void setStatsSource(StatsSource runtimeStatsSource)
public StatsSource getStatsSource()
public boolean hasResultSet()
hasResultSet
in interface IDriver
public void setCompactionWriteIds(org.apache.hadoop.hive.common.ValidWriteIdList val)
Copyright © 2022 The Apache Software Foundation. All rights reserved.