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

Support timeFormat extraction function for Druid as filter field #8728

Conversation

dinsaw
Copy link
Contributor

@dinsaw dinsaw commented Dec 3, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

The timeFormat extraction function works as group by field but does not work as filter field.

{
  "type": "extraction",
  "dimension": "__time",
  "outputName": "dayOfMonth",
  "extractionFn":{
    "type" : "timeFormat",
    "format" : "d",
    "timeZone" : "Asia/Kolkata",
    "locale" : "en"
  }
}

If we use this custom column as filter field, Superset gives Unsupported extraction function: timeFormat error.

FIX:

I have used existing TimeFormatExtraction from pydruid to support this.

TEST PLAN

  • Create custom druid column as mentioned above.
  • Use the column as filter in any chart. We have checked this for Line Chart and Big number with Trendline Chart

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@dinsaw dinsaw force-pushed the support-timeformat-extraction-function-in-filter branch from 20dfff9 to c221430 Compare December 3, 2019 07:03
@dinsaw dinsaw closed this Dec 3, 2019
@dinsaw dinsaw reopened this Dec 3, 2019
@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

Merging #8728 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8728      +/-   ##
==========================================
+ Coverage   65.57%   65.57%   +<.01%     
==========================================
  Files         482      482              
  Lines       24083    24085       +2     
  Branches     2763     2763              
==========================================
+ Hits        15792    15794       +2     
  Misses       8111     8111              
  Partials      180      180
Impacted Files Coverage Δ
superset/connectors/druid/models.py 82.35% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e998be...e17af6f. Read the comment docs.

@dinsaw dinsaw force-pushed the support-timeformat-extraction-function-in-filter branch from c221430 to 8db945e Compare December 3, 2019 08:02
@dinsaw dinsaw force-pushed the support-timeformat-extraction-function-in-filter branch from 8db945e to e17af6f Compare December 3, 2019 08:14
@mistercrunch mistercrunch merged commit cae0583 into apache:master Dec 8, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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 size/XS 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants