This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 257c100 Fixed Time Grain and Added Drill to README (#7635)
257c100 is described below
commit 257c100c5966c431abf19f6e813842aef8e588b5
Author: Charles S. Givre <[email protected]>
AuthorDate: Sun Jun 2 09:13:59 2019 -0400
Fixed Time Grain and Added Drill to README (#7635)
* Fixed Time Grain and Added Drill to README
* Capitalization Fix
---
README.md | 1 +
superset/db_engine_specs.py | 20 ++++++++++----------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 962c8c9..396b8b6 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 89e677b..5136bca 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -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