mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
add oracle time_grains (#1544)
This commit is contained in:
parent
1d7d5469a9
commit
757e7de60c
@ -285,6 +285,24 @@ class RedshiftEngineSpec(PostgresEngineSpec):
|
||||
class OracleEngineSpec(PostgresEngineSpec):
|
||||
engine = 'oracle'
|
||||
|
||||
time_grains = (
|
||||
Grain('Time Column', _('Time Column'), '{col}'),
|
||||
Grain('minute', _('minute'),
|
||||
"TRUNC(TO_DATE({col}), 'MI')"),
|
||||
Grain('hour', _('hour'),
|
||||
"TRUNC(TO_DATE({col}), 'HH')"),
|
||||
Grain('day', _('day'),
|
||||
"TRUNC(TO_DATE({col}), 'DDD')"),
|
||||
Grain('week', _('week'),
|
||||
"TRUNC(TO_DATE({col}), 'WW')"),
|
||||
Grain('month', _('month'),
|
||||
"TRUNC(TO_DATE({col}), 'MONTH')"),
|
||||
Grain('quarter', _('quarter'),
|
||||
"TRUNC(TO_DATE({col}), 'Q')"),
|
||||
Grain('year', _('year'),
|
||||
"TRUNC(TO_DATE({col}), 'YEAR')"),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type, dttm):
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user