druid.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .. Licensed to the Apache Software Foundation (ASF) under one
  2. or more contributor license agreements. See the NOTICE file
  3. distributed with this work for additional information
  4. regarding copyright ownership. The ASF licenses this file
  5. to you under the Apache License, Version 2.0 (the
  6. "License"); you may not use this file except in compliance
  7. with the License. You may obtain a copy of the License at
  8. .. http://www.apache.org/licenses/LICENSE-2.0
  9. .. Unless required by applicable law or agreed to in writing,
  10. software distributed under the License is distributed on an
  11. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, either express or implied. See the License for the
  13. specific language governing permissions and limitations
  14. under the License.
  15. Druid
  16. =====
  17. Superset has a native connector to Druid and a majority of Druid's
  18. features are accessible through Superset.
  19. .. note ::
  20. Druid now supports SQL and can be accessed through Superset's
  21. SQLAlchemy connector. The long-term vision is to deprecate
  22. the Druid native REST connector and query Druid exclusively through
  23. the SQL interface.
  24. Aggregations
  25. ------------
  26. Common aggregations or Druid metrics can be defined and used in Superset.
  27. The first and simpler use case is to use the checkbox matrix expose in your
  28. datasource's edit view (``Sources -> Druid Datasources ->
  29. [your datasource] -> Edit -> [tab] List Druid Column``).
  30. Clicking the ``GroupBy`` and ``Filterable`` checkboxes will make the column
  31. appear in the related dropdowns while in explore view. Checking
  32. ``Count Distinct``, ``Min``, ``Max`` or ``Sum`` will result in creating
  33. new metrics that will appear in the ``List Druid Metric`` tab upon saving the
  34. datasource. By editing these metrics, you'll notice that their ``json``
  35. element corresponds to Druid aggregation definition. You can create your own
  36. aggregations manually from the ``List Druid Metric`` tab following Druid
  37. documentation.
  38. .. image:: _static/images/druid_agg.png
  39. :scale: 50 %
  40. Post-Aggregations
  41. -----------------
  42. Druid supports post aggregation and this works in Superset. All you have to
  43. do is create a metric, much like you would create an aggregation manually,
  44. but specify ``postagg`` as a ``Metric Type``. You then have to provide a valid
  45. json post-aggregation definition (as specified in the Druid docs) in the
  46. Json field.
  47. Unsupported Features
  48. --------------------
  49. .. note ::
  50. Unclear at this point, this section of the documentation could use
  51. some input.