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() |
org.apache.hadoop.hive.metastore.api.Schema |
getExplainSchema() |
FetchTask |
getFetchTask() |
HookRunner |
getHookRunner() |
int |
getMaxRows()
Return the maximum number of rows returned by getResults
|
QueryPlan |
getPlan() |
PlanMapper |
getPlanMapper() |
QueryDisplay |
getQueryDisplay() |
org.apache.hadoop.hive.ql.plan.api.Query |
getQueryPlan() |
QueryState |
getQueryState() |
boolean |
getResults(List res) |
org.apache.hadoop.hive.metastore.api.Schema |
getSchema() |
StatsSource |
getStatsSource() |
org.apache.hadoop.hive.metastore.api.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
Exceptionpublic org.apache.hadoop.hive.metastore.api.Schema getSchema()
public org.apache.hadoop.hive.metastore.api.Schema getExplainSchema()
public Context getContext()
getContext in interface IDriverpublic PlanMapper getPlanMapper()
public org.apache.hadoop.hive.metastore.api.Schema getThriftSchema()
throws Exception
Exceptionpublic int getMaxRows()
public void setMaxRows(int maxRows)
setMaxRows in interface IDriverpublic 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 queryHiveExceptionAuthorizationExceptionpublic QueryPlan getPlan()
public FetchTask getFetchTask()
getFetchTask in interface IDriverpublic void releaseLocksAndCommitOrRollback(boolean commit)
throws LockException
LockExceptionpublic 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 sessionLockExceptionpublic void releaseResources()
public CommandProcessorResponse run(String command)
run in interface IDriverrun in interface CommandProcessorpublic CommandProcessorResponse run()
public CommandProcessorResponse run(String command, boolean alreadyCompiled)
public CommandProcessorResponse compileAndRespond(String command)
compileAndRespond in interface IDriverpublic CommandProcessorResponse compileAndRespond(String command, boolean cleanupTxnList)
public void lockAndRespond()
throws CommandProcessorResponse
CommandProcessorResponsepublic boolean isFetchingTable()
isFetchingTable in interface IDriverpublic boolean getResults(List res) throws IOException
getResults in interface IDriverIOExceptionpublic void resetFetch()
throws IOException
resetFetch in interface IDriverIOExceptionpublic void close()
close in interface AutoCloseableclose in interface IDriverpublic org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan()
throws IOException
IOExceptionpublic String getErrorMsg()
public QueryDisplay getQueryDisplay()
getQueryDisplay in interface IDriverpublic void setOperationId(String opId)
setOperationId in interface IDriveropId - base64 encoded guid stringpublic QueryState getQueryState()
public HookRunner getHookRunner()
public void setStatsSource(StatsSource runtimeStatsSource)
public StatsSource getStatsSource()
public boolean hasResultSet()
hasResultSet in interface IDriverpublic void setCompactionWriteIds(org.apache.hadoop.hive.common.ValidWriteIdList val)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.