@Override public void dropView(SchemaConfig schemaConfig, List<String> tableSchemaPath) throws IOException { if(!getMutability().hasMutationCapability(MutationType.VIEW, schemaConfig.isSystemUser())) { throw UserException.parseError() .message("Unable to drop view. Schema [%s] is immutable for this user.", this.name) .build(logger); } getFS(schemaConfig.getUserName()).delete(getViewPath(tableSchemaPath), false); }
@Override public boolean createOrUpdateView(NamespaceKey key, View view, SchemaConfig schemaConfig) throws IOException { if(!getMutability().hasMutationCapability(MutationType.VIEW, schemaConfig.isSystemUser())) { throw UserException.parseError() .message("Unable to create view. Schema [%s] is immutable for this user.", key.getParent()) .build(logger); } Path viewPath = getViewPath(key.getPathComponents()); FileSystemWrapper fs = getFS(schemaConfig.getUserName()); boolean replaced = fs.exists(viewPath); final FsPermission viewPerms = new FsPermission(schemaConfig.getOption(ExecConstants.NEW_VIEW_DEFAULT_PERMS_KEY).getStringVal()); try (OutputStream stream = FileSystemWrapper.create(fs, viewPath, viewPerms)) { lpPersistance.getMapper().writeValue(stream, view); } return replaced; }
@Override public CreateTableEntry createNewTable(SchemaConfig config, NamespaceKey key, WriterOptions writerOptions, Map<String, Object> storageOptions) { if(!getMutability().hasMutationCapability(MutationType.TABLE, config.isSystemUser())) { throw UserException.parseError() .message("Unable to create table. Schema [%s] is immutable for this user.", key.getParent())
if(!getMutability().hasMutationCapability(MutationType.TABLE, schemaConfig.isSystemUser())) { throw UserException.parseError() .message("Unable to drop table. Schema [%s] is immutable for this user.", this.name)