gpt4 book ai didi

com.facebook.presto.sql.tree.WindowFrame.getType()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 02:45:05 25 4
gpt4 key购买 nike

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

WindowFrame.getType介绍

暂无

代码示例

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

@Override
public String visitWindowFrame(WindowFrame node, Void context)
{
  StringBuilder builder = new StringBuilder();
  builder.append(node.getType().toString()).append(' ');
  if (node.getEnd().isPresent()) {
    builder.append("BETWEEN ")
        .append(process(node.getStart(), context))
        .append(" AND ")
        .append(process(node.getEnd().get(), context));
  }
  else {
    builder.append(process(node.getStart(), context));
  }
  return builder.toString();
}

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

frameType = frame.getType();

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

private void analyzeWindowFrame(WindowFrame frame)
{
  FrameBound.Type startType = frame.getStart().getType();
  FrameBound.Type endType = frame.getEnd().orElse(new FrameBound(CURRENT_ROW)).getType();
  if (startType == UNBOUNDED_FOLLOWING) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame start cannot be UNBOUNDED FOLLOWING");
  }
  if (endType == UNBOUNDED_PRECEDING) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame end cannot be UNBOUNDED PRECEDING");
  }
  if ((startType == CURRENT_ROW) && (endType == PRECEDING)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from CURRENT ROW cannot end with PRECEDING");
  }
  if ((startType == FOLLOWING) && (endType == PRECEDING)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from FOLLOWING cannot end with PRECEDING");
  }
  if ((startType == FOLLOWING) && (endType == CURRENT_ROW)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from FOLLOWING cannot end with CURRENT ROW");
  }
  if ((frame.getType() == RANGE) && ((startType == PRECEDING) || (endType == PRECEDING))) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame RANGE PRECEDING is only supported with UNBOUNDED");
  }
  if ((frame.getType() == RANGE) && ((startType == FOLLOWING) || (endType == FOLLOWING))) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame RANGE FOLLOWING is only supported with UNBOUNDED");
  }
}

代码示例来源:origin: rakam-io/rakam

@Override
public String visitWindowFrame(WindowFrame node, Void context) {
  StringBuilder builder = new StringBuilder();
  builder.append(node.getType().toString()).append(' ');
  if (node.getEnd().isPresent()) {
    builder.append("BETWEEN ")
        .append(process(node.getStart(), context))
        .append(" AND ")
        .append(process(node.getEnd().get(), context));
  } else {
    builder.append(process(node.getStart(), context));
  }
  return builder.toString();
}

代码示例来源:origin: com.facebook.presto/presto-parser

@Override
public String visitWindowFrame(WindowFrame node, Void context)
{
  StringBuilder builder = new StringBuilder();
  builder.append(node.getType().toString()).append(' ');
  if (node.getEnd().isPresent()) {
    builder.append("BETWEEN ")
        .append(process(node.getStart(), context))
        .append(" AND ")
        .append(process(node.getEnd().get(), context));
  }
  else {
    builder.append(process(node.getStart(), context));
  }
  return builder.toString();
}

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

@Override
public String visitWindowFrame(WindowFrame node, Boolean unmangleNames)
{
  StringBuilder builder = new StringBuilder();
  builder.append(node.getType().toString()).append(' ');
  if (node.getEnd().isPresent()) {
    builder.append("BETWEEN ")
        .append(process(node.getStart(), unmangleNames))
        .append(" AND ")
        .append(process(node.getEnd().get(), unmangleNames));
  }
  else {
    builder.append(process(node.getStart(), unmangleNames));
  }
  return builder.toString();
}

代码示例来源:origin: vqtran/EchoQuery

@Override
public String visitWindowFrame(WindowFrame node, Boolean unmangleNames)
{
  StringBuilder builder = new StringBuilder();
  builder.append(node.getType().toString()).append(' ');
  if (node.getEnd().isPresent()) {
    builder.append("BETWEEN ")
        .append(process(node.getStart(), unmangleNames))
        .append(" AND ")
        .append(process(node.getEnd().get(), unmangleNames));
  }
  else {
    builder.append(process(node.getStart(), unmangleNames));
  }
  return builder.toString();
}

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

frameType = frame.getType();

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

private static void analyzeWindowFrame(WindowFrame frame)
{
  FrameBound.Type startType = frame.getStart().getType();
  FrameBound.Type endType = frame.getEnd().orElse(new FrameBound(CURRENT_ROW)).getType();
  if (startType == UNBOUNDED_FOLLOWING) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame start cannot be UNBOUNDED FOLLOWING");
  }
  if (endType == UNBOUNDED_PRECEDING) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame end cannot be UNBOUNDED PRECEDING");
  }
  if ((startType == CURRENT_ROW) && (endType == PRECEDING)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from CURRENT ROW cannot end with PRECEDING");
  }
  if ((startType == FOLLOWING) && (endType == PRECEDING)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from FOLLOWING cannot end with PRECEDING");
  }
  if ((startType == FOLLOWING) && (endType == CURRENT_ROW)) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame starting from FOLLOWING cannot end with CURRENT ROW");
  }
  if ((frame.getType() == RANGE) && ((startType == PRECEDING) || (endType == PRECEDING))) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame RANGE PRECEDING is only supported with UNBOUNDED");
  }
  if ((frame.getType() == RANGE) && ((startType == FOLLOWING) || (endType == FOLLOWING))) {
    throw new SemanticException(INVALID_WINDOW_FRAME, frame, "Window frame RANGE FOLLOWING is only supported with UNBOUNDED");
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com