private CreationMetadata convertToCreationMetadata( MCreationMetadata s) throws MetaException { if (s == null) { return null; } Set<String> tablesUsed = new HashSet<>(); for (MTable mtbl : s.getTables()) { tablesUsed.add( Warehouse.getQualifiedName( mtbl.getDatabase().getName(), mtbl.getTableName())); } CreationMetadata r = new CreationMetadata(s.getCatalogName(), s.getDbName(), s.getTblName(), tablesUsed); r.setMaterializationTime(s.getMaterializationTime()); if (s.getTxnList() != null) { r.setValidTxnList(s.getTxnList()); } return r; }
public Table build(Configuration conf) throws MetaException { if (tableName == null) { throw new MetaException("You must set the table name"); } if (ownerType == null) { ownerType = PrincipalType.USER; } if (owner == null) { try { owner = SecurityUtils.getUser(); } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf); Table t = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, buildSd(), partCols, tableParams, viewOriginalText, viewExpandedText, type); if (rewriteEnabled) t.setRewriteEnabled(true); if (temporary) t.setTemporary(temporary); t.setCatName(catName); if (!mvReferencedTables.isEmpty()) { CreationMetadata cm = new CreationMetadata(catName, dbName, tableName, mvReferencedTables); if (mvValidTxnList != null) cm.setValidTxnList(mvValidTxnList); t.setCreationMetadata(cm); } return t; }
unsetValidTxnList(); } else { setValidTxnList((String)value);
mvTable.getTableName(), ImmutableSet.copyOf(mvTable.getCreationMetadata().getTablesUsed())); cm.setValidTxnList(conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY)); db.updateCreationMetadata(mvTable.getDbName(), mvTable.getTableName(), cm);
new CreationMetadata(MetaStoreUtils.getDefaultCatalog(conf), tbl.getDbName(), tbl.getTableName(), ImmutableSet.copyOf(crtView.getTablesUsed())); cm.setValidTxnList(conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY)); tbl.getTTable().setCreationMetadata(cm);
private CreationMetadata convertToCreationMetadata( MCreationMetadata s) throws MetaException { if (s == null) { return null; } Set<String> tablesUsed = new HashSet<>(); for (MTable mtbl : s.getTables()) { tablesUsed.add( Warehouse.getQualifiedName( mtbl.getDatabase().getName(), mtbl.getTableName())); } CreationMetadata r = new CreationMetadata(s.getCatalogName(), s.getDbName(), s.getTblName(), tablesUsed); r.setMaterializationTime(s.getMaterializationTime()); if (s.getTxnList() != null) { r.setValidTxnList(s.getTxnList()); } return r; }
public Table build(Configuration conf) throws MetaException { if (tableName == null) { throw new MetaException("You must set the table name"); } if (owner == null) { try { owner = SecurityUtils.getUser(); } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf); Table t = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, buildSd(), partCols, tableParams, viewOriginalText, viewExpandedText, type); if (rewriteEnabled) t.setRewriteEnabled(true); if (temporary) t.setTemporary(temporary); t.setCatName(catName); if (!mvReferencedTables.isEmpty()) { CreationMetadata cm = new CreationMetadata(catName, dbName, tableName, mvReferencedTables); if (mvValidTxnList != null) cm.setValidTxnList(mvValidTxnList); t.setCreationMetadata(cm); } return t; }