io.prestosql.sql.tree.Query.getWith()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(142)

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

Query.getWith介绍

暂无

代码示例

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

@Override
protected R visitQuery(Query node, C context)
{
  if (node.getWith().isPresent()) {
    process(node.getWith().get(), context);
  }
  process(node.getQueryBody(), context);
  if (node.getOrderBy().isPresent()) {
    process(node.getOrderBy().get(), context);
  }
  return null;
}

代码示例来源:origin: io.prestosql/presto-parser

@Override
protected R visitQuery(Query node, C context)
{
  if (node.getWith().isPresent()) {
    process(node.getWith().get(), context);
  }
  process(node.getQueryBody(), context);
  if (node.getOrderBy().isPresent()) {
    process(node.getOrderBy().get(), context);
  }
  return null;
}

代码示例来源:origin: io.prestosql/presto-parser

@Override
protected Void visitQuery(Query node, Integer indent)
  if (node.getWith().isPresent()) {
    With with = node.getWith().get();
    append(indent, "WITH");
    if (with.isRecursive()) {

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

@Override
protected Void visitQuery(Query node, Integer indent)
  if (node.getWith().isPresent()) {
    With with = node.getWith().get();
    append(indent, "WITH");
    if (with.isRecursive()) {

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

Optional.of("0"));
zeroRowsQuery = new io.prestosql.sql.tree.Query(createSelectClause.getWith(), innerQuery, Optional.empty(), Optional.empty());
zeroRowsQuery = new io.prestosql.sql.tree.Query(createSelectClause.getWith(), innerQuery, Optional.empty(), Optional.of("0"));

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

private void validateShowStatsSubquery(ShowStats node, Query query, QuerySpecification querySpecification, Plan plan)
{
  // The following properties of SELECT subquery are required:
  //  - only one relation in FROM
  //  - only predicates that can be pushed down can be in the where clause
  //  - no group by
  //  - no having
  //  - no set quantifier
  Optional<FilterNode> filterNode = searchFrom(plan.getRoot())
      .where(FilterNode.class::isInstance)
      .findSingle();
  check(!filterNode.isPresent(), node, "Only predicates that can be pushed down are supported in the SHOW STATS WHERE clause");
  check(querySpecification.getFrom().isPresent(), node, "There must be exactly one table in query passed to SHOW STATS SELECT clause");
  check(querySpecification.getFrom().get() instanceof Table, node, "There must be exactly one table in query passed to SHOW STATS SELECT clause");
  check(!query.getWith().isPresent(), node, "WITH is not supported by SHOW STATS SELECT clause");
  check(!querySpecification.getOrderBy().isPresent(), node, "ORDER BY is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getLimit().isPresent(), node, "LIMIT is not supported by SHOW STATS SELECT clause");
  check(!querySpecification.getHaving().isPresent(), node, "HAVING is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getGroupBy().isPresent(), node, "GROUP BY is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getSelect().isDistinct(), node, "DISTINCT is not supported by SHOW STATS SELECT clause");
  List<SelectItem> selectItems = querySpecification.getSelect().getSelectItems();
  check(selectItems.size() == 1 && selectItems.get(0) instanceof AllColumns, node, "Only SELECT * is supported in SHOW STATS SELECT clause");
}

代码示例来源:origin: io.prestosql/presto-main

private void validateShowStatsSubquery(ShowStats node, Query query, QuerySpecification querySpecification, Plan plan)
{
  // The following properties of SELECT subquery are required:
  //  - only one relation in FROM
  //  - only predicates that can be pushed down can be in the where clause
  //  - no group by
  //  - no having
  //  - no set quantifier
  Optional<FilterNode> filterNode = searchFrom(plan.getRoot())
      .where(FilterNode.class::isInstance)
      .findSingle();
  check(!filterNode.isPresent(), node, "Only predicates that can be pushed down are supported in the SHOW STATS WHERE clause");
  check(querySpecification.getFrom().isPresent(), node, "There must be exactly one table in query passed to SHOW STATS SELECT clause");
  check(querySpecification.getFrom().get() instanceof Table, node, "There must be exactly one table in query passed to SHOW STATS SELECT clause");
  check(!query.getWith().isPresent(), node, "WITH is not supported by SHOW STATS SELECT clause");
  check(!querySpecification.getOrderBy().isPresent(), node, "ORDER BY is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getLimit().isPresent(), node, "LIMIT is not supported by SHOW STATS SELECT clause");
  check(!querySpecification.getHaving().isPresent(), node, "HAVING is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getGroupBy().isPresent(), node, "GROUP BY is not supported in SHOW STATS SELECT clause");
  check(!querySpecification.getSelect().isDistinct(), node, "DISTINCT is not supported by SHOW STATS SELECT clause");
  List<SelectItem> selectItems = querySpecification.getSelect().getSelectItems();
  check(selectItems.size() == 1 && selectItems.get(0) instanceof AllColumns, node, "Only SELECT * is supported in SHOW STATS SELECT clause");
}

代码示例来源:origin: io.prestosql/presto-main

private Scope analyzeWith(Query node, Optional<Scope> scope)
  if (!node.getWith().isPresent()) {
    return createScope(scope);
  With with = node.getWith().get();
  if (with.isRecursive()) {
    throw new SemanticException(NOT_SUPPORTED, with, "Recursive WITH queries are not supported");

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

private Scope analyzeWith(Query node, Optional<Scope> scope)
  if (!node.getWith().isPresent()) {
    return createScope(scope);
  With with = node.getWith().get();
  if (with.isRecursive()) {
    throw new SemanticException(NOT_SUPPORTED, with, "Recursive WITH queries are not supported");

相关文章