diff --git a/src/main/java/org/usf/jquery/core/DBColumn.java b/src/main/java/org/usf/jquery/core/DBColumn.java index 437d7df..087850e 100644 --- a/src/main/java/org/usf/jquery/core/DBColumn.java +++ b/src/main/java/org/usf/jquery/core/DBColumn.java @@ -452,7 +452,7 @@ public JDBCType getType() { @Override public boolean resolve(QueryBuilder builder) { - return true; //agg + return false; //agg } @Override diff --git a/src/main/java/org/usf/jquery/core/OperationColumn.java b/src/main/java/org/usf/jquery/core/OperationColumn.java index 6888893..8e67c43 100644 --- a/src/main/java/org/usf/jquery/core/OperationColumn.java +++ b/src/main/java/org/usf/jquery/core/OperationColumn.java @@ -61,8 +61,7 @@ else if(operator.is("OVER")) { } return requirePartition().resolve(builder); //no aggregation } - return operator.is(ConstantOperator.class) - || tryResolveAll(builder, args); + return !operator.is(ConstantOperator.class) && tryResolveAll(builder, args); } @Override diff --git a/src/main/java/org/usf/jquery/core/Operator.java b/src/main/java/org/usf/jquery/core/Operator.java index e3f5fdb..659ae78 100644 --- a/src/main/java/org/usf/jquery/core/Operator.java +++ b/src/main/java/org/usf/jquery/core/Operator.java @@ -166,6 +166,10 @@ static TypedOperator rpad() { return new TypedOperator(VARCHAR, function("RPAD"), required(BIGINT, VARCHAR), required(INTEGER), required(VARCHAR)); } + static TypedOperator age() { //td interval type + return new TypedOperator(VARCHAR, function("AGE"), required(DATE, TIMESTAMP, TIMESTAMP_WITH_TIMEZONE), optional(DATE, TIMESTAMP, TIMESTAMP_WITH_TIMEZONE)); + } + //temporal functions static TypedOperator year() { @@ -252,6 +256,10 @@ static TypedOperator varchar() { return new TypedOperator(VARCHAR, cast("VARCHAR"), required(), optional(INTEGER)); //any } + static TypedOperator timestamp() { + return new TypedOperator(TIMESTAMP, cast("TIMESTAMP"), required(VARCHAR, DATE)); + } + static TypedOperator date() { return new TypedOperator(DATE, cast("DATE"), required(VARCHAR, TIMESTAMP, TIMESTAMP_WITH_TIMEZONE)); } @@ -260,10 +268,6 @@ static TypedOperator time() { return new TypedOperator(TIME, cast("TIME"), required(TIMESTAMP, TIMESTAMP_WITH_TIMEZONE)); } - static TypedOperator timestamp() { - return new TypedOperator(TIMESTAMP, cast("TIMESTAMP"), required(VARCHAR, DATE)); - } - static TypedOperator integer() { return new TypedOperator(INTEGER, cast("INTEGER"), required(VARCHAR, DOUBLE)); }