Skip to content

Commit

Permalink
Fixed Time Grain and Added Drill to README (#7635)
Browse files Browse the repository at this point in the history
* Fixed Time Grain and Added Drill to README

* Capitalization Fix
  • Loading branch information
cgivre authored and villebro committed Jun 2, 2019
1 parent 1dc17f3 commit 257c100
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Superset can be used to visualize data out of most databases:
* Redshift
* Clickhouse
* Apache Kylin
* Apache Drill
* Google BigQuery
* **more!** look for the availability of a SQLAlchemy dialect for your database
to find out whether it will work with Superset
Expand Down
20 changes: 10 additions & 10 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,16 +753,16 @@ class DrillEngineSpec(BaseEngineSpec):

time_grain_functions = {
None: '{col}',
'PT1S': "nearestDate({col}, 'SECOND')",
'PT1M': "nearestDate({col}, 'MINUTE')",
'PT15M': "nearestDate({col}, 'QUARTER_HOUR')",
'PT0.5H': "nearestDate({col}, 'HALF_HOUR')",
'PT1H': "nearestDate({col}, 'HOUR')",
'P1D': 'TO_DATE({col})',
'P1W': "nearestDate({col}, 'WEEK_SUNDAY')",
'P1M': "nearestDate({col}, 'MONTH')",
'P0.25Y': "nearestDate({col}, 'QUARTER')",
'P1Y': "nearestDate({col}, 'YEAR')",
'PT1S': "NEARESTDATE({col}, 'SECOND')",
'PT1M': "NEARESTDATE({col}, 'MINUTE')",
'PT15M': "NEARESTDATE({col}, 'QUARTER_HOUR')",
'PT0.5H': "NEARESTDATE({col}, 'HALF_HOUR')",
'PT1H': "NEARESTDATE({col}, 'HOUR')",
'P1D': "NEARESTDATE({col}, 'DAY')",
'P1W': "NEARESTDATE({col}, 'WEEK_SUNDAY')",
'P1M': "NEARESTDATE({col}, 'MONTH')",
'P0.25Y': "NEARESTDATE({col}, 'QUARTER')",
'P1Y': "NEARESTDATE({col}, 'YEAR')",
}

# Returns a function to convert a Unix timestamp in milliseconds to a date
Expand Down

0 comments on commit 257c100

Please sign in to comment.