static void validateTable(org.apache.hadoop.hive.ql.metadata.Table table) throws SemanticException { if (table.isNonNative()) { throw new SemanticException(ErrorMsg.EXIM_FOR_NON_NATIVE.getMsg()); } }
static void validateTable(org.apache.hadoop.hive.ql.metadata.Table table) throws SemanticException { if (table.isNonNative()) { throw new SemanticException(ErrorMsg.EXIM_FOR_NON_NATIVE.getMsg()); } }
public HiveStorageHandler getStorageHandler() { if (storageHandler != null || !isNonNative()) { return storageHandler; } try { storageHandler = HiveUtils.getStorageHandler( SessionState.getSessionConf(), getProperty( org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_STORAGE)); } catch (Exception e) { throw new RuntimeException(e); } return storageHandler; }
public HiveStorageHandler getStorageHandler() { if (storageHandler != null || !isNonNative()) { return storageHandler; } try { storageHandler = HiveUtils.getStorageHandler( SessionState.getSessionConf(), getProperty( org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_STORAGE)); } catch (Exception e) { throw new RuntimeException(e); } return storageHandler; }
if (table.isNonNative()) { return true; // nothing can be done
if (table.isNonNative()) { return true; // nothing can be done
if (!tbl.isNonNative()) { return originalPredicate;
new MaskAndFilterInfo(colTypes, additionalTabInfo.toString(), alias, astNode, table.isView(), table.isNonNative()));
private void validateAlterTableType(Table tbl, AlterTableTypes op, boolean expectView) throws SemanticException { if (tbl.isView()) { if (!expectView) { throw new SemanticException(ErrorMsg.ALTER_COMMAND_FOR_VIEWS.getMsg()); } switch (op) { case ADDPARTITION: case DROPPARTITION: case RENAMEPARTITION: case ADDPROPS: case DROPPROPS: case RENAME: // allow this form break; default: throw new SemanticException(ErrorMsg.ALTER_VIEW_DISALLOWED_OP.getMsg(op.toString())); } } else { if (expectView) { throw new SemanticException(ErrorMsg.ALTER_COMMAND_FOR_TABLES.getMsg()); } } if (tbl.isNonNative() && !AlterTableTypes.nonNativeTableAllowedTypes.contains(op)) { throw new SemanticException(ErrorMsg.ALTER_TABLE_NON_NATIVE.getMsg(tbl.getTableName())); } }
if (!tbl.isNonNative()) { return originalPredicate;
/** * validates if a table can be exported, similar to EximUtil.shouldExport with few replication * specific checks. */ public static Boolean shouldReplicate(ReplicationSpec replicationSpec, Table tableHandle, HiveConf hiveConf) { if (replicationSpec == null) { replicationSpec = new ReplicationSpec(); } if (replicationSpec.isNoop() || tableHandle == null) { return false; } // if its metadata only, then dump metadata of non native tables also. if (tableHandle.isNonNative() && !replicationSpec.isMetadataOnly()) { return false; } if (replicationSpec.isInReplicationScope()) { if (tableHandle.isTemporary()) { return false; } if (MetaStoreUtils.isExternalTable(tableHandle.getTTable())) { return hiveConf.getBoolVar(HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES) || replicationSpec.isMetadataOnly(); } } return true; }
if(!tab.isNonNative()) {
/** * Validate noscan command * * @param tree * @throws SemanticException */ private void validateAnalyzeNoscan(ASTNode tree) throws SemanticException { // since it is noscan, it is true table name in command String tableName = getUnescapedName((ASTNode) tree.getChild(0).getChild(0)); Table tbl; try { tbl = this.getTableObjectByName(tableName); } catch (InvalidTableException e) { throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tableName), e); } catch (HiveException e) { throw new SemanticException(e.getMessage(), e); } /* noscan uses hdfs apis to retrieve such information from Namenode. */ /* But that will be specific to hdfs. Through storagehandler mechanism, */ /* storage of table could be on any storage system: hbase, cassandra etc. */ /* A nice error message should be given to user. */ if (tbl.isNonNative()) { throw new SemanticException(ErrorMsg.ANALYZE_TABLE_NOSCAN_NON_NATIVE.getMsg(tbl .getTableName())); } }
private void validateAlterTableType(Table tbl, AlterTableTypes op, boolean expectView) throws SemanticException { if (tbl.isView()) { if (!expectView) { throw new SemanticException(ErrorMsg.ALTER_COMMAND_FOR_VIEWS.getMsg()); } switch (op) { case ADDPARTITION: case DROPPARTITION: case RENAMEPARTITION: case ADDPROPS: case DROPPROPS: case RENAME: // allow this form break; default: throw new SemanticException(ErrorMsg.ALTER_VIEW_DISALLOWED_OP.getMsg(op.toString())); } } else { if (expectView) { throw new SemanticException(ErrorMsg.ALTER_COMMAND_FOR_TABLES.getMsg()); } } if (tbl.isNonNative()) { throw new SemanticException(ErrorMsg.ALTER_TABLE_NON_NATIVE.getMsg(tbl.getTableName())); } }
/** * Validate noscan command * * @param tree * @throws SemanticException */ private void validateAnalyzeNoscan(ASTNode tree) throws SemanticException { // since it is noscan, it is true table name in command String tableName = getUnescapedName((ASTNode) tree.getChild(0).getChild(0)); Table tbl; try { tbl = this.getTableObjectByName(tableName); } catch (InvalidTableException e) { throw new SemanticException(ErrorMsg.INVALID_TABLE.getMsg(tableName), e); } catch (HiveException e) { throw new SemanticException(e.getMessage(), e); } /* noscan uses hdfs apis to retrieve such information from Namenode. */ /* But that will be specific to hdfs. Through storagehandler mechanism, */ /* storage of table could be on any storage system: hbase, cassandra etc. */ /* A nice error message should be given to user. */ if (tbl.isNonNative()) { throw new SemanticException(ErrorMsg.ANALYZE_TABLE_NOSCAN_NON_NATIVE.getMsg(tbl .getTableName())); } }
throw new SemanticException(ErrorMsg.DML_AGAINST_VIEW.getMsg()); if (ts.tableHandle.isNonNative()) { throw new SemanticException(ErrorMsg.LOAD_INTO_NON_NATIVE.getMsg());
if (tblObj.isNonNative()) { throw new SemanticException(ErrorMsg.CONCATENATE_UNSUPPORTED_TABLE_NON_NATIVE.getMsg());
throw new SemanticException(ErrorMsg.DML_AGAINST_VIEW.getMsg()); if (ts.tableHandle.isNonNative()) { throw new SemanticException(ErrorMsg.LOAD_INTO_NON_NATIVE.getMsg());
if (table.isNonNative()) { throw new SemanticException(ErrorMsg.TRUNCATE_FOR_NON_NATIVE_TABLE.format(tableName)); //TODO
if (tbl.isNonNative()) { throw new SemanticException(ErrorMsg.ANALYZE_TABLE_PARTIALSCAN_NON_NATIVE.getMsg(tbl .getTableName()));