Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using undefined DruidMetrics for limit_spec #4114

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

bolkedebruin
Copy link
Contributor

@bolkedebruin bolkedebruin commented Dec 25, 2017

in case a form did not specify a metric (e.g. mapbox). If it is
not available it now defaults to the first dimension instead.

This fixes issue #3604

@mistercrunch @Fokko @amoussoubaruch

It probably warrants a unittest, I am still figuring out how those work in Superset (ie. I know where to find them, but trying to wrap my mind around what the right adjustment is)

in case a form did not specify a metric (e.g. mapbox). If it is
not available it now defaults to the first dimension instead.

This fixes issue apache#3604
@bolkedebruin bolkedebruin changed the title Superset was using undefined metrics for specifying limits Fix using undefined DruidMetrics for limit_spec Dec 27, 2017
@mistercrunch
Copy link
Member

mistercrunch commented Jan 3, 2018

This part of the codebase is growing a bit out of control (not your fault! it's been slipping out of control for a long time...). . Sidenote here is that the future way forward with Druid (according to Druid core committers) is with the SQL interface. For now the SQL interface vs JSON still has pros/cons and I'd assume many people are using earlier versions of Druid where JSON is the only way, so we'll have to support the JSON connector for a while.

Coworker @betodealmeida at Lyft just rolled out https://github.com/betodealmeida/druid-dbapi/ which has a DBAPI driver and SQLAlchemy dialect for Druid, meaning we'll be able to use Druid through the SQLAlchemy interface.


So is it fair to say that this bug occurs with metrics that have groupby but no metrics?

Now if it's a bug with Mapbox viz, it seems like is_timeseries should be False and we shouldn't be in the section of the code under if timeseries_limit and is_timeseries: (unless this bug occurs in another context?)

@bolkedebruin
Copy link
Contributor Author

bolkedebruin commented Jan 3, 2018

Ah that looks great! I’m aware of the effort to create a sql interface to Druid. That should put adoption on steroids I guess, but it will take awhile before that is deemed stable.

So I think you’re right on how the issue is triggered from MapBox, due to the absence of a defined metric in the UI superset defaults to a set of pre-defined ones which 1) are not in the query and thus not known to Druid and 2) not normalize (as done at other places) to just it’s value hence being unserializable.

The pr uses the dimension as per Druid spec if a metric is absent.

So setting ‘is_timeseries’ to false probably fixes the symptom but will hide the bug.

@bolkedebruin
Copy link
Contributor Author

@mistercrunch anything holding this back? It is an error in the Druid interface (and will not just affect MapBox).

@mistercrunch
Copy link
Member

Ooops, that one had slipped in a crack, mergin'

@mistercrunch mistercrunch merged commit 7e36488 into apache:master Jan 12, 2018
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
in case a form did not specify a metric (e.g. mapbox). If it is
not available it now defaults to the first dimension instead.

This fixes issue apache#3604
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
in case a form did not specify a metric (e.g. mapbox). If it is
not available it now defaults to the first dimension instead.

This fixes issue apache#3604
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants