com.facebook.presto.metadata.Metadata.dropView()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中com.facebook.presto.metadata.Metadata.dropView()方法的一些代码示例,展示了Metadata.dropView()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.dropView()方法的具体详情如下:
包路径:com.facebook.presto.metadata.Metadata
类名称:Metadata
方法名:dropView

Metadata.dropView介绍

[英]Drops the specified view.
[中]删除指定的视图。

代码示例

代码示例来源:origin: prestodb/presto

@Override
  public ListenableFuture<?> execute(DropView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters)
  {
    Session session = stateMachine.getSession();
    QualifiedObjectName name = createQualifiedObjectName(session, statement, statement.getName());

    Optional<ViewDefinition> view = metadata.getView(session, name);
    if (!view.isPresent()) {
      if (!statement.isExists()) {
        throw new SemanticException(MISSING_TABLE, statement, "View '%s' does not exist", name);
      }
      return immediateFuture(null);
    }

    accessControl.checkCanDropView(session.getRequiredTransactionId(), session.getIdentity(), name);

    metadata.dropView(session, name);

    return immediateFuture(null);
  }
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@Override
  public CompletableFuture<?> execute(DropView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine)
  {
    Session session = stateMachine.getSession();
    QualifiedObjectName name = createQualifiedObjectName(session, statement, statement.getName());

    Optional<ViewDefinition> view = metadata.getView(session, name);
    if (!view.isPresent()) {
      if (!statement.isExists()) {
        throw new SemanticException(MISSING_TABLE, statement, "View '%s' does not exist", name);
      }
      return completedFuture(null);
    }

    accessControl.checkCanDropView(session.getRequiredTransactionId(), session.getIdentity(), name);

    metadata.dropView(session, name);

    return completedFuture(null);
  }
}

相关文章