if (throwException) { LOG.error("Table " + tableName + " not found: " + e.getMessage()); throw new InvalidTableException(tableName);
LOG.debug(te.getMessage());
tblObj = db.getTable(tblName); } catch (InvalidTableException e) { LOG.warn("Trying to drop table " + e.getTableName() + ". But it does not exist."); continue; tblObj = db.getTable(tblName); } catch (InvalidTableException e) { LOG.warn("Trying to drop table " + e.getTableName() + ". But it does not exist."); continue;
console.printError("Table " + e.getTableName() + " does not exist"); LOG.debug(stringifyException(e)); return 1;
if (throwException) { LOG.error("Table " + dbName + "." + tableName + " not found: " + e.getMessage()); throw new InvalidTableException(tableName);
/** * @param throwException if false, return null if table doesn't exist, else throw */ protected static Table getTable(ASTNode tabRef, Hive db, boolean throwException) throws SemanticException { String[] tableName; switch (tabRef.getType()) { case HiveParser.TOK_TABREF: tableName = getQualifiedTableName((ASTNode) tabRef.getChild(0)); break; case HiveParser.TOK_TABNAME: tableName = getQualifiedTableName(tabRef); break; default: throw raiseWrongType("TOK_TABREF|TOK_TABNAME", tabRef); } Table mTable; try { mTable = db.getTable(tableName[0], tableName[1], throwException); } catch (InvalidTableException e) { LOG.error("Failed to find table " + getDotName(tableName) + " got exception " + e.getMessage()); throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(getDotName(tableName)), e); } catch (HiveException e) { LOG.error("Failed to find table " + getDotName(tableName) + " got exception " + e.getMessage()); throw new SemanticException(e.getMessage(), e); } return mTable; }
private Table getTableOrFail(String schemaName, String tableName) throws InvalidTableException, SQLException { // hive is case-insensitive AbstractMap.SimpleEntry<String, String> key = new AbstractMap.SimpleEntry<>( Utils.toUpperCase(schemaName), Utils.toUpperCase(tableName)); if (nonExistentTables.getIfPresent(key) == Boolean.FALSE) { throw new InvalidTableException( schemaName != null ? schemaName + '.' + tableName : tableName); } try { return tableCache.get(key); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof InvalidTableException) { nonExistentTables.put(key, Boolean.FALSE); throw (InvalidTableException)cause; } else { throw Util.generateCsSQLException(SQLState.TABLE_NOT_FOUND, tableName, cause); } } }
/** * @return the Metastore representation of the target table */ private Table getTargetTable(ASTNode tabRef) throws SemanticException { String[] tableName; Table mTable; switch (tabRef.getType()) { case HiveParser.TOK_TABREF: tableName = getQualifiedTableName((ASTNode) tabRef.getChild(0)); break; case HiveParser.TOK_TABNAME: tableName = getQualifiedTableName(tabRef); break; default: throw raiseWrongType("TOK_TABREF|TOK_TABNAME", tabRef); } try { mTable = db.getTable(tableName[0], tableName[1]); } catch (InvalidTableException e) { LOG.error("Failed to find table " + getDotName(tableName) + " got exception " + e.getMessage()); throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(getDotName(tableName)), e); } catch (HiveException e) { LOG.error("Failed to find table " + getDotName(tableName) + " got exception " + e.getMessage()); throw new SemanticException(e.getMessage(), e); } return mTable; } // Walk through all our inputs and set them to note that this read is part of an update or a
if (throwException) { LOG.error("Table " + tableName + " not found: " + e.getMessage()); throw new InvalidTableException(tableName);
} catch (InvalidTableException e) { LOG.error("Failed to find table " + getDotName(tableName) + " got exception " + e.getMessage()); throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(getDotName(tableName)), e); } catch (HiveException e) {
if (throwException) { LOG.error(StringUtils.stringifyException(e)); throw new InvalidTableException("Table " + tableName + " not found ", tableName);