You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/09 04:39:33 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #8939: Add support for Dremio as a new source

villebro commented on a change in pull request #8939: Add support for Dremio as a new source
URL: https://github.com/apache/incubator-superset/pull/8939#discussion_r364556599
 
 

 ##########
 File path: superset/db_engine_specs/dremio.py
 ##########
 @@ -0,0 +1,18 @@
+from superset.db_engine_specs.base import BaseEngineSpec
+import sqlalchemy_dremio.pyodbc
+
+class DremioBaseEngineSpec(BaseEngineSpec):
+
+    engine = "dremio"
+
+    _time_grain_functions = {
+        None: "{col}",
+        "PT1S": "DATE_TRUNC('second', {col})",
+        "PT1M": "DATE_TRUNC('minute', {col})",
+        "PT1H": "DATE_TRUNC('hour', {col})",
+        "P1D": "DATE_TRUNC('day', {col})",
+        "P1W": "DATE_TRUNC('week', {col})",
+        "P1M": "DATE_TRUNC('month', {col})",
+        "P0.25Y": "DATE_TRUNC('quarter', {col})",
+        "P1Y": "DATE_TRUNC('year', {col})",
+    }
 
 Review comment:
   Please add line change to last row.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org