private static boolean isLockableTable(Table t) { if (t.isTemporary()) { return false; } switch (t.getTableType()) { case MANAGED_TABLE: case MATERIALIZED_VIEW: return true; default: return false; } }
@Explain(displayName = "isTempTable", jsonOnly = true) public boolean isTemporary() { return tableMetadata.isTemporary(); }
private boolean areEventsForDmlNeeded(Table tbl, Partition oldPart) { // For Acid IUD, add partition is a meta data only operation. So need to add the new files added // information into the TXN_WRITE_NOTIFICATION_LOG table. return conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML) && !tbl.isTemporary() && ((null != oldPart) || AcidUtils.isTransactionalTable(tbl)); }
public TableExport(Paths paths, TableSpec tableSpec, ReplicationSpec replicationSpec, Hive db, String distCpDoAsUser, HiveConf conf, MmContext mmCtx) { this.tableSpec = (tableSpec != null && tableSpec.tableHandle.isTemporary() && replicationSpec.isInReplicationScope()) ? null : tableSpec; this.replicationSpec = replicationSpec; if (conf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_METADATA_ONLY) || (this.tableSpec != null && this.tableSpec.tableHandle.isView())) { this.replicationSpec.setIsMetadataOnly(true); this.tableSpec.tableHandle.setStatsStateLikeNewTable(); } this.db = db; this.distCpDoAsUser = distCpDoAsUser; this.conf = conf; this.paths = paths; this.mmCtx = mmCtx; }
if (conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML)) { LOG.debug("Firing dml insert event"); if (tbl.isTemporary()) { LOG.debug("Not firing dml insert event as " + tbl.getTableName() + " is temporary"); return;
if (tbl.isTemporary()) { LOG.debug("write notification log is ignored as " + tbl.getTableName() + " is temporary : " + writeId); return;
if (tbl.isTemporary()) { duplicateProps.add("TEMPORARY"); tbl_temp = "TEMPORARY ";
EximUtil.validateTable(ts.tableHandle); if (replicationSpec.isInReplicationScope() && ts.tableHandle.isTemporary()){
if (conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML)) { LOG.debug("Firing dml insert event"); if (tbl.isTemporary()) { LOG.debug("Not firing dml insert event as " + tbl.getTableName() + " is temporary"); return;
@Override public RelNode visit(TableScan scan) { if (scan instanceof HiveTableScan) { HiveTableScan hiveScan = (HiveTableScan) scan; RelOptHiveTable relOptHiveTable = (RelOptHiveTable) hiveScan.getTable(); Table tab = relOptHiveTable.getHiveTableMD(); if (tab.isTemporary()) { fail(tab.getTableName() + " is a temporary table"); } if (tab.getTableType() == TableType.EXTERNAL_TABLE) { fail(tab.getFullyQualifiedName() + " is an external table"); } return scan; } // TableScan of a non-Hive table - don't support for materializations. fail(scan.getTable().getQualifiedName() + " is a table scan of a non-Hive table."); return scan; }
/** * 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; }
isSrcLocal, isAutoPurge); } else { if (conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML) && !tbl.isTemporary() && oldPart != null) { newFiles = Collections.synchronizedList(new ArrayList<Path>());
&& (privObject.getT() == null || privObject.getT().isTemporary())) {
destPath = loadPath = tgtPath; isAutoPurge = "true".equalsIgnoreCase(table.getProperty("auto.purge")); if (table.isTemporary()) { needRecycle = false; } else {
boolean isFullAcidTable = AcidUtils.isFullAcidTable(tbl); if (conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML) && !tbl.isTemporary()) { newFiles = Collections.synchronizedList(new ArrayList<Path>()); boolean needRecycle = !tbl.isTemporary() && ReplChangeManager.isSourceOfReplication(Hive.get().getDatabase(tbl.getDbName())); replaceFiles(tblPath, loadPath, destPath, tblPath, conf, isSrcLocal, isAutopurge,
Table tbl = getTable(tableName); HiveConf sessionConf = SessionState.getSessionConf(); if (conf.getBoolVar(ConfVars.FIRE_EVENTS_FOR_DML) && !tbl.isTemporary()) { newFiles = Collections.synchronizedList(new ArrayList<Path>());
destPath = tgtLocation; isAutoPurge = "true".equalsIgnoreCase(table.getProperty("auto.purge")); if (table.isTemporary()) { needRecycle = false; } else {
try { Table table = this.getTableObjectByName(qb.getTabNameForAlias(alias)); if (table.isTemporary()) { throw new SemanticException("View definition references temporary table " + alias);
if (table.isTemporary()) { throw new SemanticException("View definition references temporary table " + alias);
table.getTableName(), false, // isExternal: set to false here, can be overwritten by the IMPORT stmt table.isTemporary(), table.getSd().getCols(), table.getPartitionKeys(),