use localtime/localtimestamp on HSQL and Postgres

Since we don't need the TIME ZONE for our current_time
and current_timestamp functions, these are cleaner
mappings to SQL for these functions.
This commit is contained in:
Gavin King 2020-08-25 10:39:57 +02:00 committed by Andrea Boriero
parent fbba9ed4a8
commit 0ecb05614f
2 changed files with 30 additions and 0 deletions

View File

@ -212,6 +212,21 @@ public void initializeFunctionRegistry(QueryEngine queryEngine) {
}
}
@Override
public String currentTime() {
return "localtime";
}
@Override
public String currentTimestamp() {
return "localtimestamp";
}
@Override
public String currentTimestampWithTimeZone() {
return "current_timestamp";
}
@Override
public SqlAstTranslatorFactory getSqlAstTranslatorFactory() {
return new StandardSqlAstTranslatorFactory() {

View File

@ -122,6 +122,21 @@ public int getVersion() {
return version;
}
@Override
public String currentTime() {
return "localtime";
}
@Override
public String currentTimestamp() {
return "localtimestamp";
}
@Override
public String currentTimestampWithTimeZone() {
return "current_timestamp";
}
/**
* The {@code extract()} function returns {@link TemporalUnit#DAY_OF_WEEK}
* numbered from 0 to 6. This isn't consistent with what most other