Add support for AT TIME ZONE expressions#1196
Add support for AT TIME ZONE expressions#1196wumpz merged 3 commits intoJSQLParser:masterfrom tomershay:add_support_for_at_time_zone
Conversation
|
@wumpz, can you please share if there is a way to add further tests to increase coverage for the uncovered parts? Didn't see a way to do that as part of the existing testing suite. Thanks! |
|
Greetings @tomershay, I ran into the same issue a few days ago.
An over simplified example: private int foo(int i) {
if (i>0) {
return 1;
} else {
return 0;
}
}
@test
private void fooTest() {
assertEquals(1, foo(1));
}The test above will execute the You would need to add another test, that triggers that part. |
|
@tomershay Thx for adding this. |
Adding support for AT TIME ZONE expressions, used for example in PostgreSQL.
Sample usages:
SELECT creation_date AT TIME ZONE 'UTC';SELECT DATE(date1 AT TIME ZONE 'UTC' AT TIME ZONE 'australia/sydney') AS another_date;This PR doesn't cover all time zone related options that can be done on an expression, but is only a start.
Documentation and samples (some of the capabilities described aren't yet supported):
https://www.postgresql.org/docs/9.2/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT
https://www.enterprisedb.com/postgres-tutorials/postgres-time-zone-explained
This PR potentially fixes or makes progress with issues: #214, #1115