本文整理汇总了Java中org.apache.hadoop.hive.ql.processors.CommandProcessorResponse.getErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:Java CommandProcessorResponse.getErrorMessage方法的具体用法?Java CommandProcessorResponse.getErrorMessage怎么用?Java CommandProcessorResponse.getErrorMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.ql.processors.CommandProcessorResponse
的用法示例。
在下文中一共展示了CommandProcessorResponse.getErrorMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeHQL
import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; //导入方法依赖的package包/类
/**
*
* @param hql
* @throws CommandNeedRetryException
* @throws IOException
*/
public void executeHQL(String hql) throws CommandNeedRetryException, IOException {
CommandProcessorResponse response = getDriver().run(hql);
int retCode = response.getResponseCode();
if (retCode != 0) {
String err = response.getErrorMessage();
throw new IOException("Failed to execute hql [" + hql + "], error message is: " + err);
}
}
示例2: execHiveDDL
import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; //导入方法依赖的package包/类
public void execHiveDDL(String ddl) throws Exception {
LOG.info("Executing ddl = " + ddl);
Driver hiveDriver = new Driver();
CommandProcessorResponse response = hiveDriver.run(ddl);
if (response.getResponseCode() > 0) {
throw new Exception(response.getErrorMessage());
}
}
示例3: verifyLocalQuery
import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; //导入方法依赖的package包/类
public void verifyLocalQuery(String queryStr) throws Exception {
// setup Hive driver
SessionState session = new SessionState(getHiveConf());
SessionState.start(session);
Driver driver = new Driver(session.getConf(), getUser());
// compile the query
CommandProcessorResponse compilerStatus = driver
.compileAndRespond(queryStr);
if (compilerStatus.getResponseCode() != 0) {
String errMsg = compilerStatus.getErrorMessage();
if (errMsg.contains(HiveAuthzConf.HIVE_SENTRY_PRIVILEGE_ERROR_MESSAGE)) {
printMissingPerms(getHiveConf().get(
HiveAuthzConf.HIVE_SENTRY_AUTH_ERRORS));
}
throw new SemanticException("Compilation error: "
+ compilerStatus.getErrorMessage());
}
driver.close();
System.out
.println("User " + getUser() + " has privileges to run the query");
}
示例4: execHiveDDL
import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; //导入方法依赖的package包/类
public void execHiveDDL(String ddl) throws Exception {
LOG.info("Executing ddl = " + ddl);
Driver hiveDriver = new Driver();
CommandProcessorResponse response = hiveDriver.run(ddl);
if (response.getResponseCode() > 0) {
throw new Exception(response.getErrorMessage());
}
}
示例5: executeHQL
import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; //导入方法依赖的package包/类
/**
* only used by Deploy Util
*/
@Override
public void executeHQL(String hql) throws CommandNeedRetryException, IOException {
CommandProcessorResponse response = getDriver().run(hql);
int retCode = response.getResponseCode();
if (retCode != 0) {
String err = response.getErrorMessage();
throw new IOException("Failed to execute hql [" + hql + "], error message is: " + err);
}
}