apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.61k stars 13.81k forks source link

Time Grain Not Available in Azure Databricks #10199

Closed rbk-paul closed 3 years ago

rbk-paul commented 4 years ago

A clear and concise description of what the bug is.

The "Time Grain" filter does not have any options available (shows "0 Options"), despite detecting correct the various "Time Columns". This problem exists for all Visualization Types.

Found a similar issue reported but was closed and marked stale: https://github.com/apache/incubator-superset/issues/8009

Data Source is from Azure Databricks.

Expected results

Time Grain filter shows different options like Year, Month, Day...

Actual results

Shows "0 Options"

Screenshots

Screenshot 2020-06-30 at 5 55 45 PM

How to reproduce the bug

  1. Create any Visualization Type connecting to any tables from a Azure Databricks data source
  2. "Time Grain" does not show options

Environment

(please complete the following information):

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

Additional context

Add any other context about the problem here.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.73. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

MApeldoorn commented 4 years ago

Hi,

I am having the same issue. Running SuperSet 0.36, but had the same problem in 0.29.

Connection to a sqlalchemy_sqlany backend. DATETIME_ID (type TIMESTAMP) and DAET_ID (type DATE) are giving 0 Time Grain option(s). I have tried multiple datetime-translation, but no success.

With kind regards, Mark

mistercrunch commented 4 years ago

What does your connection string look like? What SQL dialect is this most like? Hive?

You probably want to add a new module here: https://github.com/apache/incubator-superset/tree/master/superset/db_engine_specs

villebro commented 4 years ago

@rbk-paul are you connecting using this connector? https://pypi.org/project/databricks-dbapi/

rbk-paul commented 4 years ago

@villebro. yes, using the connector you specified.

@mistercrunch, connection string looks like this: databricks+pyhive://token:databrick_access_token>@<databrick_host:/

MApeldoorn commented 4 years ago

@mistercrunch : In my case: sqlalchemy_sqlany://..., connecting to Sybase

MApeldoorn commented 4 years ago

What does your connection string look like? What SQL dialect is this most like? Hive? You probably want to add a new module here: https://github.com/apache/incubator-superset/tree/master/superset/db_engine_specs

It worked for me. I copied the mssql.py db_engine_specs, renamed it to sqlalchemy_sqlany. Only thing I had to fix after that was replace the "0" within DATEADD and DATEDIFF. The results these functions get comparing to todays datetime is giving an error (probably too high value). Replacing "0" by e.g. '2020-01-01' did the trick.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.