- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.facebook.presto.sql.tree.WindowFrame.getStart()
方法的一些代码示例,展示了WindowFrame.getStart()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowFrame.getStart()
方法的具体详情如下:
包路径:com.facebook.presto.sql.tree.WindowFrame
类名称:WindowFrame
方法名:getStart
暂无
代码示例来源: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
@Override
public R visitWindowFrame(WindowFrame node, C context)
{
process(node.getStart(), context);
if (node.getEnd().isPresent()) {
process(node.getEnd().get(), context);
}
return null;
}
代码示例来源:origin: prestodb/presto
@Override
public Boolean visitWindowFrame(WindowFrame node, Void context)
{
Optional<Expression> start = node.getStart().getValue();
if (start.isPresent()) {
if (!process(start.get(), context)) {
throw new SemanticException(MUST_BE_AGGREGATE_OR_GROUP_BY, start.get(), "Window frame start must be an aggregate expression or appear in GROUP BY clause");
}
}
if (node.getEnd().isPresent() && node.getEnd().get().getValue().isPresent()) {
Expression endValue = node.getEnd().get().getValue().get();
if (!process(endValue, context)) {
throw new SemanticException(MUST_BE_AGGREGATE_OR_GROUP_BY, endValue, "Window frame end must be an aggregate expression or appear in GROUP BY clause");
}
}
return true;
}
代码示例来源:origin: prestodb/presto
frameType = frame.getType();
frameStartType = frame.getStart().getType();
frameStart = frame.getStart().getValue().orElse(null);
代码示例来源:origin: prestodb/presto
WindowFrame frame = node.getWindow().get().getFrame().get();
if (frame.getStart().getValue().isPresent()) {
Type type = process(frame.getStart().getValue().get(), context);
if (!type.equals(INTEGER) && !type.equals(BIGINT)) {
throw new SemanticException(TYPE_MISMATCH, node, "Window frame start value type must be INTEGER or BIGINT(actual %s)", type);
代码示例来源: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-parser
@Override
public R visitWindowFrame(WindowFrame node, C context)
{
process(node.getStart(), context);
if (node.getEnd().isPresent()) {
process(node.getEnd().get(), context);
}
return null;
}
代码示例来源:origin: com.facebook.presto/presto-parser
@Override
public R visitWindowFrame(WindowFrame node, C context)
{
process(node.getStart(), context);
if (node.getEnd().isPresent()) {
process(node.getEnd().get(), context);
}
return null;
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
@Override
public Boolean visitWindowFrame(WindowFrame node, Void context)
{
Optional<Expression> start = node.getStart().getValue();
if (start.isPresent()) {
if (!process(start.get(), context)) {
throw new SemanticException(MUST_BE_AGGREGATE_OR_GROUP_BY, start.get(), "Window frame start must be an aggregate expression or appear in GROUP BY clause");
}
}
if (node.getEnd().isPresent() && node.getEnd().get().getValue().isPresent()) {
Expression endValue = node.getEnd().get().getValue().get();
if (!process(endValue, context)) {
throw new SemanticException(MUST_BE_AGGREGATE_OR_GROUP_BY, endValue, "Window frame end must be an aggregate expression or appear in GROUP BY clause");
}
}
return true;
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
frameType = frame.getType();
frameStartType = frame.getStart().getType();
frameStart = frame.getStart().getValue().orElse(null);
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
WindowFrame frame = node.getWindow().get().getFrame().get();
if (frame.getStart().getValue().isPresent()) {
Type type = process(frame.getStart().getValue().get(), context);
if (!type.equals(BIGINT)) {
throw new SemanticException(TYPE_MISMATCH, node, "Window frame start value type must be BIGINT (actual %s)", type);
代码示例来源: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");
}
}
本文整理了Java中com.facebook.presto.sql.tree.WindowFrame.getStart()方法的一些代码示例,展示了WindowFrame.getStart()的具体用
当我使用 ProcessWindowFunction 时,如下所示: private static class pwf extends ProcessWindowFunctio
我是网络开发的新手,我正在做我的项目。您对解决此问题的帮助将大有帮助。 我在 4 个 blade PHP 代码中遇到了这个路由错误。第一个错误出现在第 429 行。我该如何纠正它? ** * Ge
我是一名优秀的程序员,十分优秀!