public CreationMetadata deepCopy() { return new CreationMetadata(this); }
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; }
case 17: // CREATION_METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creationMetadata = new CreationMetadata(); struct.creationMetadata.read(iprot); struct.setCreationMetadataIsSet(true);
struct.creationMetadata = new CreationMetadata(); struct.creationMetadata.read(iprot); struct.setCreationMetadataIsSet(true);
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; }
private Table createTable(String dbName, String tableName, TableType type) throws Exception { TableBuilder builder = new TableBuilder() .setCatName("hive") .setDbName(dbName) .setTableName(tableName) .addCol("id", "int") .addCol("name", "string") .setType(type.name()); Table table = builder.build(metaStore.getConf()); if (type == TableType.MATERIALIZED_VIEW) { CreationMetadata cm = new CreationMetadata( MetaStoreUtils.getDefaultCatalog(metaStore.getConf()), dbName, tableName, ImmutableSet.of()); table.setCreationMetadata(cm); } if (type == TableType.EXTERNAL_TABLE) { table.getParameters().put("EXTERNAL", "true"); } return table; }
Table mvTable = db.getTable(getWork().getViewName()); CreationMetadata cm = new CreationMetadata(MetaStoreUtils.getDefaultCatalog(conf), mvTable.getDbName(), mvTable.getTableName(), ImmutableSet.copyOf(mvTable.getCreationMetadata().getTablesUsed()));
new CreationMetadata(MetaStoreUtils.getDefaultCatalog(conf), tbl.getDbName(), tbl.getTableName(), ImmutableSet.copyOf(crtView.getTablesUsed())); cm.setValidTxnList(conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY));
case 16: // CREATION_METADATA if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.creationMetadata = new CreationMetadata(); struct.creationMetadata.read(iprot); struct.setCreationMetadataIsSet(true);
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; }
struct.creationMetadata = new CreationMetadata(); struct.creationMetadata.read(iprot); struct.setCreationMetadataIsSet(true);
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; }