Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
usfalami committed Sep 11, 2024
1 parent 6c98584 commit 0a2a70c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/usf/jquery/core/DBColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public JDBCType getType() {

@Override
public boolean resolve(QueryBuilder builder) {
return true; //agg
return false; //agg
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/usf/jquery/core/OperationColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/org/usf/jquery/core/Operator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand Down

0 comments on commit 0a2a70c

Please sign in to comment.