mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
rename
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
*.pyc
|
||||
panoramix
|
||||
caravel
|
||||
superset
|
||||
babel
|
||||
.DS_Store
|
||||
.coverage
|
||||
@@ -10,11 +11,13 @@ build
|
||||
tmp
|
||||
dashed_config.py
|
||||
caravel_config.py
|
||||
superset_config.py
|
||||
local_config.py
|
||||
env
|
||||
dist
|
||||
dashed.egg-info/
|
||||
caravel.egg-info/
|
||||
superset.egg-info/
|
||||
env_py3
|
||||
.eggs
|
||||
dashed/
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Overview: module code — Caravel's documentation documentation</title>
|
||||
<title>Overview: module code — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="../genindex.html"/>
|
||||
<link rel="search" title="Search" href="../search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="../index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="../index.html"/>
|
||||
|
||||
|
||||
<script src="../_static/js/modernizr.min.js"></script>
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="../index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="../index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -115,6 +115,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="../sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -163,7 +164,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="../index.html">Caravel's documentation</a>
|
||||
<a href="../index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -193,7 +194,7 @@
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<h1>All modules for which code is available</h1>
|
||||
<ul><li><a href="caravel/jinja_context.html">caravel.jinja_context</a></li>
|
||||
<ul><li><a href="superset/jinja_context.html">superset.jinja_context</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Druid
|
||||
=====
|
||||
|
||||
Caravel works well with Druid, though currently not all
|
||||
Superset works well with Druid, though currently not all
|
||||
advanced features out of Druid are covered. This page clarifies what is
|
||||
covered and what isn't and explains how to use some of the features.
|
||||
|
||||
@@ -15,7 +15,7 @@ Supported
|
||||
Aggregations
|
||||
------------
|
||||
|
||||
Common aggregations, or Druid metrics can be defined and used in Caravel.
|
||||
Common aggregations, or Druid metrics can be defined and used in Superset.
|
||||
The first and simpler use case is to use the checkbox matrix expose in your
|
||||
datasource's edit view (``Sources -> Druid Datasources ->
|
||||
[your datasource] -> Edit -> [tab] List Druid Column``).
|
||||
@@ -34,7 +34,7 @@ documentation.
|
||||
Post-Aggregations
|
||||
-----------------
|
||||
|
||||
Druid supports post aggregation and this works in Caravel. All you have to
|
||||
Druid supports post aggregation and this works in Superset. All you have to
|
||||
do is creating a metric, much like you would create an aggregation manually,
|
||||
but specify ``postagg`` as a ``Metric Type``. You then have to provide a valid
|
||||
json post-aggregation definition (as specified in the Druid docs) in the
|
||||
|
||||
@@ -4,7 +4,7 @@ FAQ
|
||||
|
||||
Can I query/join multiple tables at one time?
|
||||
---------------------------------------------
|
||||
Not directly no. A Caravel SQLAlchemy datasource can only be a single table
|
||||
Not directly no. A Superset SQLAlchemy datasource can only be a single table
|
||||
or a view.
|
||||
|
||||
When working with tables, the solution would be to materialize
|
||||
@@ -14,15 +14,15 @@ through some scheduled batch process.
|
||||
A view is a simple logical layer that abstract an arbitrary SQL queries as
|
||||
a virtual table. This can allow you to join and union multiple tables, and
|
||||
to apply some transformation using arbitrary SQL expressions. The limitation
|
||||
there is your database performance as Caravel effectively will run a query
|
||||
there is your database performance as Superset effectively will run a query
|
||||
on top of your query (view). A good practice may be to limit yourself to
|
||||
joining your main large table to one or many small tables only, and avoid
|
||||
using ``GROUP BY`` where possible as Caravel will do its own ``GROUP BY`` and
|
||||
using ``GROUP BY`` where possible as Superset will do its own ``GROUP BY`` and
|
||||
doing the work twice might slow down performance.
|
||||
|
||||
Whether you use a table or a view, the important factor is whether your
|
||||
database is fast enough to serve it in an interactive fashion to provide
|
||||
a good user experience in Caravel.
|
||||
a good user experience in Superset.
|
||||
|
||||
|
||||
How BIG can my data source be?
|
||||
@@ -42,7 +42,7 @@ framework, in the meantime, we've tagged a few pull requests as
|
||||
``example`` to give people examples of how to contribute new
|
||||
visualizations.
|
||||
|
||||
https://github.com/airbnb/caravel/issues?q=label%3Aexample+is%3Aclosed
|
||||
https://github.com/airbnb/superset/issues?q=label%3Aexample+is%3Aclosed
|
||||
|
||||
|
||||
Why are my queries timing out?
|
||||
@@ -53,14 +53,14 @@ it's because the web server is timing out web requests. If you want to
|
||||
increase the default (50), you can specify the timeout when starting the
|
||||
web server with the ``-t`` flag, which is expressed in seconds.
|
||||
|
||||
``caravel runserver -t 300``
|
||||
``superset runserver -t 300``
|
||||
|
||||
|
||||
Why is the map not visible in the mapbox visualization?
|
||||
-------------------------------------------------------
|
||||
|
||||
You need to register to mapbox.com, get an API key and configure it as
|
||||
``MAPBOX_API_KEY`` in ``caravel_config.py``.
|
||||
``MAPBOX_API_KEY`` in ``superset_config.py``.
|
||||
|
||||
|
||||
How to add dynamic filters to a dashboard?
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
Caravel's documentation
|
||||
Superset's documentation
|
||||
'''''''''''''''''''''''
|
||||
|
||||
Caravel is a data exploration platform designed to be visual, intuitive
|
||||
Superset is a data exploration platform designed to be visual, intuitive
|
||||
and interactive.
|
||||
|
||||
.. image:: _static/img/caravel.jpg
|
||||
|
||||
----------------
|
||||
|
||||
.. warning:: This project used to be named Panoramix and has been renamed
|
||||
to Caravel in March 2016
|
||||
to Superset in March 2016
|
||||
|
||||
Overview
|
||||
=======================================
|
||||
|
||||
@@ -4,19 +4,19 @@ Installation & Configuration
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
Caravel is tested using Python 2.7 and Python 3.4+. Python 3 is the recommended version,
|
||||
Superset is tested using Python 2.7 and Python 3.4+. Python 3 is the recommended version,
|
||||
Python 2.6 won't be supported.
|
||||
|
||||
|
||||
OS dependencies
|
||||
---------------
|
||||
|
||||
Caravel stores database connection information in its metadata database.
|
||||
Superset stores database connection information in its metadata database.
|
||||
For that purpose, we use the ``cryptography`` Python library to encrypt
|
||||
connection passwords. Unfortunately this library has OS level dependencies.
|
||||
|
||||
You may want to attempt the next step
|
||||
("Caravel installation and initialization") and come back to this step if
|
||||
("Superset installation and initialization") and come back to this step if
|
||||
you encounter an error.
|
||||
|
||||
Here's how to install them:
|
||||
@@ -47,7 +47,7 @@ attempt it, download `get-pip.py <https://bootstrap.pypa.io/get-pip.py>`_, and r
|
||||
|
||||
Python virtualenv
|
||||
-----------------
|
||||
It is recommended to install Caravel inside a virtualenv. Python 3 already ships virtualenv, for
|
||||
It is recommended to install Superset inside a virtualenv. Python 3 already ships virtualenv, for
|
||||
Python 2 you need to install it. If it's packaged for your operating systems install it from there
|
||||
otherwise you can install from pip: ::
|
||||
|
||||
@@ -73,40 +73,40 @@ and ``setuptools`` libraries.::
|
||||
|
||||
pip install --upgrade setuptools pip
|
||||
|
||||
Caravel installation and initialization
|
||||
Superset installation and initialization
|
||||
---------------------------------------
|
||||
Follow these few simple steps to install Caravel.::
|
||||
Follow these few simple steps to install Superset.::
|
||||
|
||||
# Install caravel
|
||||
pip install caravel
|
||||
# Install superset
|
||||
pip install superset
|
||||
|
||||
# Create an admin user
|
||||
fabmanager create-admin --app caravel
|
||||
fabmanager create-admin --app superset
|
||||
|
||||
# Initialize the database
|
||||
caravel db upgrade
|
||||
superset db upgrade
|
||||
|
||||
# Load some data to play with
|
||||
caravel load_examples
|
||||
superset load_examples
|
||||
|
||||
# Create default roles and permissions
|
||||
caravel init
|
||||
superset init
|
||||
|
||||
# Start the web server on port 8088
|
||||
caravel runserver -p 8088
|
||||
superset runserver -p 8088
|
||||
|
||||
# To start a development web server, use the -d switch
|
||||
# caravel runserver -d
|
||||
# superset runserver -d
|
||||
|
||||
|
||||
After installation, you should be able to point your browser to the right
|
||||
hostname:port `http://localhost:8088 <http://localhost:8088>`_, login using
|
||||
the credential you entered while creating the admin account, and navigate to
|
||||
`Menu -> Admin -> Refresh Metadata`. This action should bring in all of
|
||||
your datasources for Caravel to be aware of, and they should show up in
|
||||
your datasources for Superset to be aware of, and they should show up in
|
||||
`Menu -> Datasources`, from where you can start playing with your data!
|
||||
|
||||
Please note that *gunicorn*, Caravel default application server, does not
|
||||
Please note that *gunicorn*, Superset default application server, does not
|
||||
work on Windows so you need to use the development web server.
|
||||
The development web server though is not intended to be used on production systems
|
||||
so better use a supported platform that can run *gunicorn*.
|
||||
@@ -114,14 +114,14 @@ so better use a supported platform that can run *gunicorn*.
|
||||
Configuration behind a load balancer
|
||||
------------------------------------
|
||||
|
||||
If you are running caravel behind a load balancer or reverse proxy (e.g. NGINX
|
||||
If you are running superset behind a load balancer or reverse proxy (e.g. NGINX
|
||||
or ELB on AWS), you may need to utilise a healthcheck endpoint so that your
|
||||
load balancer knows if your caravel instance is running. This is provided
|
||||
load balancer knows if your superset instance is running. This is provided
|
||||
at ``/health`` which will return a 200 response containing "OK" if the
|
||||
webserver is running.
|
||||
|
||||
If the load balancer is inserting X-Forwarded-For/X-Forwarded-Proto headers, you
|
||||
should set `ENABLE_PROXY_FIX = True` in the caravel config file to extract and use
|
||||
should set `ENABLE_PROXY_FIX = True` in the superset config file to extract and use
|
||||
the headers.
|
||||
|
||||
|
||||
@@ -129,16 +129,16 @@ Configuration
|
||||
-------------
|
||||
|
||||
To configure your application, you need to create a file (module)
|
||||
``caravel_config.py`` and make sure it is in your PYTHONPATH. Here are some
|
||||
``superset_config.py`` and make sure it is in your PYTHONPATH. Here are some
|
||||
of the parameters you can copy / paste in that configuration module: ::
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Caravel specific config
|
||||
# Superset specific config
|
||||
#---------------------------------------------------------
|
||||
ROW_LIMIT = 5000
|
||||
CARAVEL_WORKERS = 4
|
||||
SUPERSET_WORKERS = 4
|
||||
|
||||
CARAVEL_WEBSERVER_PORT = 8088
|
||||
SUPERSET_WEBSERVER_PORT = 8088
|
||||
#---------------------------------------------------------
|
||||
|
||||
#---------------------------------------------------------
|
||||
@@ -149,10 +149,10 @@ of the parameters you can copy / paste in that configuration module: ::
|
||||
|
||||
# The SQLAlchemy connection string to your database backend
|
||||
# This connection defines the path to the database that stores your
|
||||
# caravel metadata (slices, connections, tables, dashboards, ...).
|
||||
# superset metadata (slices, connections, tables, dashboards, ...).
|
||||
# Note that the connection information to connect to the datasources
|
||||
# you want to explore are managed directly in the web UI
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/caravel.db'
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'
|
||||
|
||||
# Flask-WTF flag for CSRF
|
||||
CSRF_ENABLED = True
|
||||
@@ -161,24 +161,24 @@ of the parameters you can copy / paste in that configuration module: ::
|
||||
MAPBOX_API_KEY = ''
|
||||
|
||||
This file also allows you to define configuration parameters used by
|
||||
Flask App Builder, the web framework used by Caravel. Please consult
|
||||
Flask App Builder, the web framework used by Superset. Please consult
|
||||
the `Flask App Builder Documentation
|
||||
<http://flask-appbuilder.readthedocs.org/en/latest/config.html>`_
|
||||
for more information on how to configure Caravel.
|
||||
for more information on how to configure Superset.
|
||||
|
||||
Please make sure to change:
|
||||
|
||||
* *SQLALCHEMY_DATABASE_URI*, by default it is stored at *~/.caravel/caravel.db*
|
||||
* *SQLALCHEMY_DATABASE_URI*, by default it is stored at *~/.superset/superset.db*
|
||||
* *SECRET_KEY*, to a long random string
|
||||
|
||||
Database dependencies
|
||||
---------------------
|
||||
|
||||
Caravel does not ship bundled with connectivity to databases, except
|
||||
Superset does not ship bundled with connectivity to databases, except
|
||||
for Sqlite, which is part of the Python standard library.
|
||||
You'll need to install the required packages for the database you
|
||||
want to use as your metadata database as well as the packages needed to
|
||||
connect to the databases you want to access through Caravel.
|
||||
connect to the databases you want to access through Superset.
|
||||
|
||||
Here's a list of some of the recommended packages.
|
||||
|
||||
@@ -213,9 +213,9 @@ database you want to connect to should get you to the right place.
|
||||
Caching
|
||||
-------
|
||||
|
||||
Caravel uses `Flask-Cache <https://pythonhosted.org/Flask-Cache/>`_ for
|
||||
Superset uses `Flask-Cache <https://pythonhosted.org/Flask-Cache/>`_ for
|
||||
caching purpose. Configuring your caching backend is as easy as providing
|
||||
a ``CACHE_CONFIG``, constant in your ``caravel_config.py`` that
|
||||
a ``CACHE_CONFIG``, constant in your ``superset_config.py`` that
|
||||
complies with the Flask-Cache specifications.
|
||||
|
||||
Flask-Cache supports multiple caching backends (Redis, Memcached,
|
||||
@@ -224,7 +224,7 @@ Memcached please use the pylibmc client library as python-memcached does
|
||||
not handle storing binary data correctly. If you use Redis, please install
|
||||
[python-redis](https://pypi.python.org/pypi/redis).
|
||||
|
||||
For setting your timeouts, this is done in the Caravel metadata and goes
|
||||
For setting your timeouts, this is done in the Superset metadata and goes
|
||||
up the "timeout searchpath", from your slice configuration, to your
|
||||
data source's configuration, to your database's and ultimately falls back
|
||||
into your global default defined in ``CACHE_CONFIG``.
|
||||
@@ -252,7 +252,7 @@ Schemas (Postgres & Redshift)
|
||||
|
||||
Postgres and Redshift, as well as other database,
|
||||
use the concept of **schema** as a logical entity
|
||||
on top of the **database**. For Caravel to connect to a specific schema,
|
||||
on top of the **database**. For Superset to connect to a specific schema,
|
||||
there's a **schema** parameter you can set in the table form.
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ Druid
|
||||
|
||||
* Navigate to your datasources
|
||||
|
||||
Note that you can run the ``caravel refresh_druid`` command to refresh the
|
||||
Note that you can run the ``superset refresh_druid`` command to refresh the
|
||||
metadata from your Druid cluster(s)
|
||||
|
||||
|
||||
@@ -293,10 +293,10 @@ CORS
|
||||
|
||||
The extra CORS Dependency must be installed:
|
||||
|
||||
caravel[cors]
|
||||
superset[cors]
|
||||
|
||||
|
||||
The following keys in `caravel_config.py` can be specified to configure CORS:
|
||||
The following keys in `superset_config.py` can be specified to configure CORS:
|
||||
|
||||
|
||||
* ``ENABLE_CORS``: Must be set to True in order to enable CORS
|
||||
@@ -307,16 +307,16 @@ Upgrading
|
||||
|
||||
Upgrading should be as straightforward as running::
|
||||
|
||||
pip install caravel --upgrade
|
||||
caravel db upgrade
|
||||
caravel init
|
||||
pip install superset --upgrade
|
||||
superset db upgrade
|
||||
superset init
|
||||
|
||||
SQL Lab
|
||||
-------
|
||||
SQL Lab is a powerful SQL IDE that works with all SQLAlchemy compatible
|
||||
databases out there. By default, queries are run in a web request, and
|
||||
may eventually timeout as queries exceed the maximum duration of a web
|
||||
request in your environment, whether it'd be a reverse proxy or the Caravel
|
||||
request in your environment, whether it'd be a reverse proxy or the Superset
|
||||
server itself.
|
||||
|
||||
In the modern analytics world, it's not uncommon to run large queries that
|
||||
@@ -324,7 +324,7 @@ run for minutes or hours.
|
||||
To enable support for long running queries that
|
||||
execute beyond the typical web request's timeout (30-60 seconds), it is
|
||||
necessary to deploy an asynchronous backend, which consist of one or many
|
||||
Caravel worker, which is implemented as a Celery worker, and a Celery
|
||||
Superset worker, which is implemented as a Celery worker, and a Celery
|
||||
broker for which we recommend using Redis or RabbitMQ.
|
||||
|
||||
It's also preferable to setup an async result backend as a key value store
|
||||
@@ -333,20 +333,20 @@ details to come as to how to set this up here soon.
|
||||
|
||||
SQL Lab supports templating in queries, and it's possible to override
|
||||
the default Jinja context in your environment by defining the
|
||||
``JINJA_CONTEXT_ADDONS`` in your caravel configuration. Objects referenced
|
||||
``JINJA_CONTEXT_ADDONS`` in your superset configuration. Objects referenced
|
||||
in this dictionary are made available for users to use in their SQL.
|
||||
|
||||
|
||||
Making your own build
|
||||
---------------------
|
||||
|
||||
For more advanced users, you may want to build Caravel from sources. That
|
||||
For more advanced users, you may want to build Superset from sources. That
|
||||
would be the case if you fork the project to add features specific to
|
||||
your environment.::
|
||||
|
||||
# assuming $CARAVEL_HOME as the root of the repo
|
||||
cd $CARAVEL_HOME/caravel/assets
|
||||
# assuming $SUPERSET_HOME as the root of the repo
|
||||
cd $SUPERSET_HOME/superset/assets
|
||||
npm install
|
||||
npm run prod
|
||||
cd $CARAVEL_HOME
|
||||
cd $SUPERSET_HOME
|
||||
python setup.py install
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
Security
|
||||
========
|
||||
Security in Caravel is handled by Flask AppBuilder (FAB). FAB is a
|
||||
Security in Superset is handled by Flask AppBuilder (FAB). FAB is a
|
||||
"Simple and rapid application development framework, built on top of Flask.".
|
||||
FAB provides authentication, user management, permissions and roles.
|
||||
|
||||
|
||||
Provided Roles
|
||||
--------------
|
||||
Caravel ships with 3 roles that are handled by Caravel itself. You can
|
||||
assume that these 3 roles will stay up-to-date as Caravel evolves.
|
||||
Superset ships with 3 roles that are handled by Superset itself. You can
|
||||
assume that these 3 roles will stay up-to-date as Superset evolves.
|
||||
|
||||
Admin
|
||||
"""""
|
||||
@@ -59,17 +59,17 @@ Customizing
|
||||
The permissions exposed by FAB are very granular and allow for a great level
|
||||
of customization. FAB creates many permissions automagically for each model
|
||||
that is create (can_add, can_delete, can_show, can_edit, ...) as well as for
|
||||
each view. On top of that, Caravel can expose more granular permissions like
|
||||
each view. On top of that, Superset can expose more granular permissions like
|
||||
``all_datasource_access``.
|
||||
|
||||
We do not recommend altering the 3 base roles as there
|
||||
are a set of assumptions that Caravel build upon. It is possible though for
|
||||
are a set of assumptions that Superset build upon. It is possible though for
|
||||
you to create your own roles, and union them to existing ones.
|
||||
|
||||
Permissions
|
||||
"""""""""""
|
||||
|
||||
Roles are composed of a set of permissions, and Caravel has many categories
|
||||
Roles are composed of a set of permissions, and Superset has many categories
|
||||
of permissions. Here are the different categories of permissions:
|
||||
|
||||
- **Model & action**: models are entities like ``Dashboard``,
|
||||
|
||||
@@ -9,7 +9,7 @@ Feature Overview
|
||||
----------------
|
||||
- Connects to just about any database backend
|
||||
- A multi-tab environment to work on multiple queries at a time
|
||||
- A smooth flow to visualize your query results using Caravel's rich
|
||||
- A smooth flow to visualize your query results using Superset's rich
|
||||
visualization capabilities
|
||||
- Browse database metadata: tables, columns, indexes, partitions
|
||||
- Support for long-running queries
|
||||
@@ -21,6 +21,9 @@ Feature Overview
|
||||
`Jinja templating language <http://jinja.pocoo.org/docs/dev/>`_
|
||||
which allows for using macros in your SQL code
|
||||
|
||||
Extra features
|
||||
--------------
|
||||
- Hit ``alt + enter`` as a keyboard shortcut to run your query
|
||||
|
||||
Templating with Jinja
|
||||
---------------------
|
||||
@@ -29,7 +32,7 @@ Templating with Jinja
|
||||
|
||||
SELECT *
|
||||
FROM some_table
|
||||
WHERE partition_key = '{{ preto.latest_partition('some_table') }}'
|
||||
WHERE partition_key = '{{ presto.latest_partition('some_table') }}'
|
||||
|
||||
Templating unleashes the power and capabilities of a
|
||||
programming language within your SQL code.
|
||||
@@ -42,15 +45,16 @@ Available macros
|
||||
''''''''''''''''
|
||||
|
||||
We expose certain modules from Python's standard library in
|
||||
Caravel's Jinja context:
|
||||
Superset's Jinja context:
|
||||
- ``time``: ``time``
|
||||
- ``datetime``: ``datetime.datetime``
|
||||
- ``uuid``: ``uuid``
|
||||
- ``random``: ``random``
|
||||
- ``relativedelta``: ``dateutil.relativedelta.relativedelta``
|
||||
- more to come!
|
||||
|
||||
`Jinja's builtin filters <http://jinja.pocoo.org/docs/dev/templates/>`_ can be also be applied where needed.
|
||||
|
||||
|
||||
.. autoclass:: caravel.jinja_context.PrestoContext
|
||||
.. autoclass:: superset.jinja_context.PrestoTemplateProcessor
|
||||
:members:
|
||||
|
||||
@@ -3,7 +3,7 @@ Tutorial
|
||||
|
||||
This basic linear tutorial will take you through connecting to a database,
|
||||
adding a table, creating a slice and a dashboard. First you'll need to tell
|
||||
Caravel where to find the database you want to
|
||||
Superset where to find the database you want to
|
||||
query. First go to the database menu
|
||||
|
||||
.. image:: _static/img/tutorial/db_menu.png
|
||||
@@ -29,7 +29,7 @@ plus (``+``) sign there (similar to the one ).
|
||||
|
||||
Now enter the name of the table in the ``Table Name`` textbox, and select
|
||||
the database you just created in the ``Database`` dropdown, hit save. At this
|
||||
moment, Caravel fetched the column names, their data types and tries to guess
|
||||
moment, Superset fetched the column names, their data types and tries to guess
|
||||
which fields are metrics in dimensions. From the list view, edit the table
|
||||
that you just created by clicking the tiny pen icon.
|
||||
|
||||
@@ -42,9 +42,9 @@ showing you the list of columns in your table as well as their data types.
|
||||
.. image:: _static/img/tutorial/matrix.png
|
||||
:scale: 30 %
|
||||
|
||||
Click the checkboxes here that inform Caravel how your columns should be
|
||||
Click the checkboxes here that inform Superset how your columns should be
|
||||
shown in the explore view, and which metrics should be created. Make sure
|
||||
to inform Caravel about your date columns. You could also create
|
||||
to inform Superset about your date columns. You could also create
|
||||
"SQL expression" columns here, or metrics in that tab as aggregate expressions,
|
||||
but let's not do that just yet. Hit ``save``.
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ Videos
|
||||
======
|
||||
|
||||
Here is a collection of short videos showing different aspect
|
||||
of Caravel.
|
||||
of Superset.
|
||||
|
||||
Quick Intro
|
||||
'''''''''''
|
||||
This video demonstrates how Caravel works at a high level, it shows how
|
||||
This video demonstrates how Superset works at a high level, it shows how
|
||||
to navigate through datasets and dashboards that are already available.
|
||||
|
||||
.. youtube:: https://www.youtube.com/watch?v=3Txm_nj_R7M
|
||||
@@ -41,7 +41,7 @@ to toggle them on dashboards.
|
||||
|
||||
Adding a Table
|
||||
''''''''''''''
|
||||
This videos shows you how to expose a new table in Caravel, and how to
|
||||
This videos shows you how to expose a new table in Superset, and how to
|
||||
define the semantics on how this can be accessed by others in the ``Explore``
|
||||
and ``Dashboard`` views.
|
||||
|
||||
|
||||
17
druid.html
17
druid.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Druid — Caravel's documentation documentation</title>
|
||||
<title>Druid — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="FAQ" href="faq.html"/>
|
||||
<link rel="prev" title="Gallery" href="gallery.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
|
||||
<div class="section" id="druid">
|
||||
<h1>Druid<a class="headerlink" href="#druid" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Caravel works well with Druid, though currently not all
|
||||
<p>Superset works well with Druid, though currently not all
|
||||
advanced features out of Druid are covered. This page clarifies what is
|
||||
covered and what isn’t and explains how to use some of the features.</p>
|
||||
<div class="admonition note">
|
||||
@@ -208,7 +209,7 @@ following versions are not tested against.</p>
|
||||
<h2>Supported<a class="headerlink" href="#supported" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="aggregations">
|
||||
<h3>Aggregations<a class="headerlink" href="#aggregations" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Common aggregations, or Druid metrics can be defined and used in Caravel.
|
||||
<p>Common aggregations, or Druid metrics can be defined and used in Superset.
|
||||
The first and simpler use case is to use the checkbox matrix expose in your
|
||||
datasource’s edit view (<code class="docutils literal"><span class="pre">Sources</span> <span class="pre">-></span> <span class="pre">Druid</span> <span class="pre">Datasources</span> <span class="pre">-></span>
|
||||
<span class="pre">[your</span> <span class="pre">datasource]</span> <span class="pre">-></span> <span class="pre">Edit</span> <span class="pre">-></span> <span class="pre">[tab]</span> <span class="pre">List</span> <span class="pre">Druid</span> <span class="pre">Column</span></code>).
|
||||
@@ -224,7 +225,7 @@ documentation.</p>
|
||||
</div>
|
||||
<div class="section" id="post-aggregations">
|
||||
<h3>Post-Aggregations<a class="headerlink" href="#post-aggregations" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Druid supports post aggregation and this works in Caravel. All you have to
|
||||
<p>Druid supports post aggregation and this works in Superset. All you have to
|
||||
do is creating a metric, much like you would create an aggregation manually,
|
||||
but specify <code class="docutils literal"><span class="pre">postagg</span></code> as a <code class="docutils literal"><span class="pre">Metric</span> <span class="pre">Type</span></code>. You then have to provide a valid
|
||||
json post-aggregation definition (as specified in the Druid docs) in the
|
||||
|
||||
25
faq.html
25
faq.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>FAQ — Caravel's documentation documentation</title>
|
||||
<title>FAQ — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="prev" title="Druid" href="druid.html"/>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -116,6 +116,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -164,7 +165,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -197,7 +198,7 @@
|
||||
<h1>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="can-i-query-join-multiple-tables-at-one-time">
|
||||
<h2>Can I query/join multiple tables at one time?<a class="headerlink" href="#can-i-query-join-multiple-tables-at-one-time" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Not directly no. A Caravel SQLAlchemy datasource can only be a single table
|
||||
<p>Not directly no. A Superset SQLAlchemy datasource can only be a single table
|
||||
or a view.</p>
|
||||
<p>When working with tables, the solution would be to materialize
|
||||
a table that contains all the fields needed for your analysis, most likely
|
||||
@@ -205,14 +206,14 @@ through some scheduled batch process.</p>
|
||||
<p>A view is a simple logical layer that abstract an arbitrary SQL queries as
|
||||
a virtual table. This can allow you to join and union multiple tables, and
|
||||
to apply some transformation using arbitrary SQL expressions. The limitation
|
||||
there is your database performance as Caravel effectively will run a query
|
||||
there is your database performance as Superset effectively will run a query
|
||||
on top of your query (view). A good practice may be to limit yourself to
|
||||
joining your main large table to one or many small tables only, and avoid
|
||||
using <code class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></code> where possible as Caravel will do its own <code class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></code> and
|
||||
using <code class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></code> where possible as Superset will do its own <code class="docutils literal"><span class="pre">GROUP</span> <span class="pre">BY</span></code> and
|
||||
doing the work twice might slow down performance.</p>
|
||||
<p>Whether you use a table or a view, the important factor is whether your
|
||||
database is fast enough to serve it in an interactive fashion to provide
|
||||
a good user experience in Caravel.</p>
|
||||
a good user experience in Superset.</p>
|
||||
</div>
|
||||
<div class="section" id="how-big-can-my-data-source-be">
|
||||
<h2>How BIG can my data source be?<a class="headerlink" href="#how-big-can-my-data-source-be" title="Permalink to this headline">¶</a></h2>
|
||||
@@ -227,7 +228,7 @@ queries that scan through terabytes in an interactive fashion.</p>
|
||||
framework, in the meantime, we’ve tagged a few pull requests as
|
||||
<code class="docutils literal"><span class="pre">example</span></code> to give people examples of how to contribute new
|
||||
visualizations.</p>
|
||||
<p><a class="reference external" href="https://github.com/airbnb/caravel/issues?q=label%3Aexample+is%3Aclosed">https://github.com/airbnb/caravel/issues?q=label%3Aexample+is%3Aclosed</a></p>
|
||||
<p><a class="reference external" href="https://github.com/airbnb/superset/issues?q=label%3Aexample+is%3Aclosed">https://github.com/airbnb/superset/issues?q=label%3Aexample+is%3Aclosed</a></p>
|
||||
</div>
|
||||
<div class="section" id="why-are-my-queries-timing-out">
|
||||
<h2>Why are my queries timing out?<a class="headerlink" href="#why-are-my-queries-timing-out" title="Permalink to this headline">¶</a></h2>
|
||||
@@ -235,12 +236,12 @@ visualizations.</p>
|
||||
it’s because the web server is timing out web requests. If you want to
|
||||
increase the default (50), you can specify the timeout when starting the
|
||||
web server with the <code class="docutils literal"><span class="pre">-t</span></code> flag, which is expressed in seconds.</p>
|
||||
<p><code class="docutils literal"><span class="pre">caravel</span> <span class="pre">runserver</span> <span class="pre">-t</span> <span class="pre">300</span></code></p>
|
||||
<p><code class="docutils literal"><span class="pre">superset</span> <span class="pre">runserver</span> <span class="pre">-t</span> <span class="pre">300</span></code></p>
|
||||
</div>
|
||||
<div class="section" id="why-is-the-map-not-visible-in-the-mapbox-visualization">
|
||||
<h2>Why is the map not visible in the mapbox visualization?<a class="headerlink" href="#why-is-the-map-not-visible-in-the-mapbox-visualization" title="Permalink to this headline">¶</a></h2>
|
||||
<p>You need to register to mapbox.com, get an API key and configure it as
|
||||
<code class="docutils literal"><span class="pre">MAPBOX_API_KEY</span></code> in <code class="docutils literal"><span class="pre">caravel_config.py</span></code>.</p>
|
||||
<code class="docutils literal"><span class="pre">MAPBOX_API_KEY</span></code> in <code class="docutils literal"><span class="pre">superset_config.py</span></code>.</p>
|
||||
</div>
|
||||
<div class="section" id="how-to-add-dynamic-filters-to-a-dashboard">
|
||||
<h2>How to add dynamic filters to a dashboard?<a class="headerlink" href="#how-to-add-dynamic-filters-to-a-dashboard" title="Permalink to this headline">¶</a></h2>
|
||||
|
||||
11
gallery.html
11
gallery.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Gallery — Caravel's documentation documentation</title>
|
||||
<title>Gallery — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="Druid" href="druid.html"/>
|
||||
<link rel="prev" title="Videos" href="videos.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Index — Caravel's documentation documentation</title>
|
||||
<title>Index — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="#"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -116,6 +116,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -164,7 +165,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -205,13 +206,13 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="sqllab.html#caravel.jinja_context.PrestoContext.latest_partition">latest_partition() (caravel.jinja_context.PrestoContext method)</a>
|
||||
<dt><a href="sqllab.html#superset.jinja_context.PrestoTemplateProcessor.latest_partition">latest_partition() (superset.jinja_context.PrestoTemplateProcessor method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="sqllab.html#caravel.jinja_context.PrestoContext.latest_sub_partition">latest_sub_partition() (caravel.jinja_context.PrestoContext method)</a>
|
||||
<dt><a href="sqllab.html#superset.jinja_context.PrestoTemplateProcessor.latest_sub_partition">latest_sub_partition() (superset.jinja_context.PrestoTemplateProcessor method)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
@@ -221,7 +222,7 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%" valign="top"><dl>
|
||||
|
||||
<dt><a href="sqllab.html#caravel.jinja_context.PrestoContext">PrestoContext (class in caravel.jinja_context)</a>
|
||||
<dt><a href="sqllab.html#superset.jinja_context.PrestoTemplateProcessor">PrestoTemplateProcessor (class in superset.jinja_context)</a>
|
||||
</dt>
|
||||
|
||||
</dl></td>
|
||||
|
||||
25
index.html
25
index.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Caravel’s documentation — Caravel's documentation documentation</title>
|
||||
<title>Superset’s documentation — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="#"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="#"/>
|
||||
<link rel="next" title="Installation & Configuration" href="installation.html"/>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="#" class="icon icon-home"> Caravel's documentation
|
||||
<a href="#" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -116,6 +116,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -164,7 +165,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="#">Caravel's documentation</a>
|
||||
<a href="#">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -181,7 +182,7 @@
|
||||
<ul class="wy-breadcrumbs">
|
||||
<li><a href="#">Docs</a> »</li>
|
||||
|
||||
<li>Caravel’s documentation</li>
|
||||
<li>Superset’s documentation</li>
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
@@ -193,16 +194,15 @@
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="caravel-s-documentation">
|
||||
<h1>Caravel’s documentation<a class="headerlink" href="#caravel-s-documentation" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Caravel is a data exploration platform designed to be visual, intuitive
|
||||
<div class="section" id="superset-s-documentation">
|
||||
<h1>Superset’s documentation<a class="headerlink" href="#superset-s-documentation" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Superset is a data exploration platform designed to be visual, intuitive
|
||||
and interactive.</p>
|
||||
<img alt="_images/caravel.jpg" src="_images/caravel.jpg" />
|
||||
<hr class="docutils" />
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last">This project used to be named Panoramix and has been renamed
|
||||
to Caravel in March 2016</p>
|
||||
to Superset in March 2016</p>
|
||||
</div>
|
||||
<div class="section" id="overview">
|
||||
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
|
||||
@@ -241,7 +241,7 @@ to the user</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -265,6 +265,7 @@ to the user</li>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Installation & Configuration — Caravel's documentation documentation</title>
|
||||
<title>Installation & Configuration — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="Tutorial" href="tutorial.html"/>
|
||||
<link rel="prev" title="Caravel’s documentation" href="index.html"/>
|
||||
<link rel="prev" title="Superset’s documentation" href="index.html"/>
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -198,16 +199,16 @@
|
||||
<h1>Installation & Configuration<a class="headerlink" href="#installation-configuration" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="getting-started">
|
||||
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Caravel is tested using Python 2.7 and Python 3.4+. Python 3 is the recommended version,
|
||||
<p>Superset is tested using Python 2.7 and Python 3.4+. Python 3 is the recommended version,
|
||||
Python 2.6 won’t be supported.</p>
|
||||
</div>
|
||||
<div class="section" id="os-dependencies">
|
||||
<h2>OS dependencies<a class="headerlink" href="#os-dependencies" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Caravel stores database connection information in its metadata database.
|
||||
<p>Superset stores database connection information in its metadata database.
|
||||
For that purpose, we use the <code class="docutils literal"><span class="pre">cryptography</span></code> Python library to encrypt
|
||||
connection passwords. Unfortunately this library has OS level dependencies.</p>
|
||||
<p>You may want to attempt the next step
|
||||
(“Caravel installation and initialization”) and come back to this step if
|
||||
(“Superset installation and initialization”) and come back to this step if
|
||||
you encounter an error.</p>
|
||||
<p>Here’s how to install them:</p>
|
||||
<p>For <strong>Debian</strong> and <strong>Ubuntu</strong>, the following command will ensure that
|
||||
@@ -237,7 +238,7 @@ attempt it, download <a class="reference external" href="https://bootstrap.pypa.
|
||||
</div>
|
||||
<div class="section" id="python-virtualenv">
|
||||
<h2>Python virtualenv<a class="headerlink" href="#python-virtualenv" title="Permalink to this headline">¶</a></h2>
|
||||
<p>It is recommended to install Caravel inside a virtualenv. Python 3 already ships virtualenv, for
|
||||
<p>It is recommended to install Superset inside a virtualenv. Python 3 already ships virtualenv, for
|
||||
Python 2 you need to install it. If it’s packaged for your operating systems install it from there
|
||||
otherwise you can install from pip:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">virtualenv</span>
|
||||
@@ -264,65 +265,65 @@ and <code class="docutils literal"><span class="pre">setuptools</span></code> li
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="caravel-installation-and-initialization">
|
||||
<h2>Caravel installation and initialization<a class="headerlink" href="#caravel-installation-and-initialization" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Follow these few simple steps to install Caravel.:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Install caravel</span>
|
||||
<span class="n">pip</span> <span class="n">install</span> <span class="n">caravel</span>
|
||||
<div class="section" id="superset-installation-and-initialization">
|
||||
<h2>Superset installation and initialization<a class="headerlink" href="#superset-installation-and-initialization" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Follow these few simple steps to install Superset.:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Install superset</span>
|
||||
<span class="n">pip</span> <span class="n">install</span> <span class="n">superset</span>
|
||||
|
||||
<span class="c1"># Create an admin user</span>
|
||||
<span class="n">fabmanager</span> <span class="n">create</span><span class="o">-</span><span class="n">admin</span> <span class="o">--</span><span class="n">app</span> <span class="n">caravel</span>
|
||||
<span class="n">fabmanager</span> <span class="n">create</span><span class="o">-</span><span class="n">admin</span> <span class="o">--</span><span class="n">app</span> <span class="n">superset</span>
|
||||
|
||||
<span class="c1"># Initialize the database</span>
|
||||
<span class="n">caravel</span> <span class="n">db</span> <span class="n">upgrade</span>
|
||||
<span class="n">superset</span> <span class="n">db</span> <span class="n">upgrade</span>
|
||||
|
||||
<span class="c1"># Load some data to play with</span>
|
||||
<span class="n">caravel</span> <span class="n">load_examples</span>
|
||||
<span class="n">superset</span> <span class="n">load_examples</span>
|
||||
|
||||
<span class="c1"># Create default roles and permissions</span>
|
||||
<span class="n">caravel</span> <span class="n">init</span>
|
||||
<span class="n">superset</span> <span class="n">init</span>
|
||||
|
||||
<span class="c1"># Start the web server on port 8088</span>
|
||||
<span class="n">caravel</span> <span class="n">runserver</span> <span class="o">-</span><span class="n">p</span> <span class="mi">8088</span>
|
||||
<span class="n">superset</span> <span class="n">runserver</span> <span class="o">-</span><span class="n">p</span> <span class="mi">8088</span>
|
||||
|
||||
<span class="c1"># To start a development web server, use the -d switch</span>
|
||||
<span class="c1"># caravel runserver -d</span>
|
||||
<span class="c1"># superset runserver -d</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>After installation, you should be able to point your browser to the right
|
||||
hostname:port <a class="reference external" href="http://localhost:8088">http://localhost:8088</a>, login using
|
||||
the credential you entered while creating the admin account, and navigate to
|
||||
<cite>Menu -> Admin -> Refresh Metadata</cite>. This action should bring in all of
|
||||
your datasources for Caravel to be aware of, and they should show up in
|
||||
your datasources for Superset to be aware of, and they should show up in
|
||||
<cite>Menu -> Datasources</cite>, from where you can start playing with your data!</p>
|
||||
<p>Please note that <em>gunicorn</em>, Caravel default application server, does not
|
||||
<p>Please note that <em>gunicorn</em>, Superset default application server, does not
|
||||
work on Windows so you need to use the development web server.
|
||||
The development web server though is not intended to be used on production systems
|
||||
so better use a supported platform that can run <em>gunicorn</em>.</p>
|
||||
</div>
|
||||
<div class="section" id="configuration-behind-a-load-balancer">
|
||||
<h2>Configuration behind a load balancer<a class="headerlink" href="#configuration-behind-a-load-balancer" title="Permalink to this headline">¶</a></h2>
|
||||
<p>If you are running caravel behind a load balancer or reverse proxy (e.g. NGINX
|
||||
<p>If you are running superset behind a load balancer or reverse proxy (e.g. NGINX
|
||||
or ELB on AWS), you may need to utilise a healthcheck endpoint so that your
|
||||
load balancer knows if your caravel instance is running. This is provided
|
||||
load balancer knows if your superset instance is running. This is provided
|
||||
at <code class="docutils literal"><span class="pre">/health</span></code> which will return a 200 response containing “OK” if the
|
||||
webserver is running.</p>
|
||||
<p>If the load balancer is inserting X-Forwarded-For/X-Forwarded-Proto headers, you
|
||||
should set <cite>ENABLE_PROXY_FIX = True</cite> in the caravel config file to extract and use
|
||||
should set <cite>ENABLE_PROXY_FIX = True</cite> in the superset config file to extract and use
|
||||
the headers.</p>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
|
||||
<p>To configure your application, you need to create a file (module)
|
||||
<code class="docutils literal"><span class="pre">caravel_config.py</span></code> and make sure it is in your PYTHONPATH. Here are some
|
||||
<code class="docutils literal"><span class="pre">superset_config.py</span></code> and make sure it is in your PYTHONPATH. Here are some
|
||||
of the parameters you can copy / paste in that configuration module:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1">#---------------------------------------------------------</span>
|
||||
<span class="c1"># Caravel specific config</span>
|
||||
<span class="c1"># Superset specific config</span>
|
||||
<span class="c1">#---------------------------------------------------------</span>
|
||||
<span class="n">ROW_LIMIT</span> <span class="o">=</span> <span class="mi">5000</span>
|
||||
<span class="n">CARAVEL_WORKERS</span> <span class="o">=</span> <span class="mi">4</span>
|
||||
<span class="n">SUPERSET_WORKERS</span> <span class="o">=</span> <span class="mi">4</span>
|
||||
|
||||
<span class="n">CARAVEL_WEBSERVER_PORT</span> <span class="o">=</span> <span class="mi">8088</span>
|
||||
<span class="n">SUPERSET_WEBSERVER_PORT</span> <span class="o">=</span> <span class="mi">8088</span>
|
||||
<span class="c1">#---------------------------------------------------------</span>
|
||||
|
||||
<span class="c1">#---------------------------------------------------------</span>
|
||||
@@ -333,10 +334,10 @@ of the parameters you can copy / paste in that configuration module:</p>
|
||||
|
||||
<span class="c1"># The SQLAlchemy connection string to your database backend</span>
|
||||
<span class="c1"># This connection defines the path to the database that stores your</span>
|
||||
<span class="c1"># caravel metadata (slices, connections, tables, dashboards, ...).</span>
|
||||
<span class="c1"># superset metadata (slices, connections, tables, dashboards, ...).</span>
|
||||
<span class="c1"># Note that the connection information to connect to the datasources</span>
|
||||
<span class="c1"># you want to explore are managed directly in the web UI</span>
|
||||
<span class="n">SQLALCHEMY_DATABASE_URI</span> <span class="o">=</span> <span class="s1">'sqlite:////path/to/caravel.db'</span>
|
||||
<span class="n">SQLALCHEMY_DATABASE_URI</span> <span class="o">=</span> <span class="s1">'sqlite:////path/to/superset.db'</span>
|
||||
|
||||
<span class="c1"># Flask-WTF flag for CSRF</span>
|
||||
<span class="n">CSRF_ENABLED</span> <span class="o">=</span> <span class="kc">True</span>
|
||||
@@ -346,22 +347,22 @@ of the parameters you can copy / paste in that configuration module:</p>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This file also allows you to define configuration parameters used by
|
||||
Flask App Builder, the web framework used by Caravel. Please consult
|
||||
Flask App Builder, the web framework used by Superset. Please consult
|
||||
the <a class="reference external" href="http://flask-appbuilder.readthedocs.org/en/latest/config.html">Flask App Builder Documentation</a>
|
||||
for more information on how to configure Caravel.</p>
|
||||
for more information on how to configure Superset.</p>
|
||||
<p>Please make sure to change:</p>
|
||||
<ul class="simple">
|
||||
<li><em>SQLALCHEMY_DATABASE_URI</em>, by default it is stored at <em>~/.caravel/caravel.db</em></li>
|
||||
<li><em>SQLALCHEMY_DATABASE_URI</em>, by default it is stored at <em>~/.superset/superset.db</em></li>
|
||||
<li><em>SECRET_KEY</em>, to a long random string</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="database-dependencies">
|
||||
<h2>Database dependencies<a class="headerlink" href="#database-dependencies" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Caravel does not ship bundled with connectivity to databases, except
|
||||
<p>Superset does not ship bundled with connectivity to databases, except
|
||||
for Sqlite, which is part of the Python standard library.
|
||||
You’ll need to install the required packages for the database you
|
||||
want to use as your metadata database as well as the packages needed to
|
||||
connect to the databases you want to access through Caravel.</p>
|
||||
connect to the databases you want to access through Superset.</p>
|
||||
<p>Here’s a list of some of the recommended packages.</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
@@ -421,16 +422,16 @@ database you want to connect to should get you to the right place.</p>
|
||||
</div>
|
||||
<div class="section" id="caching">
|
||||
<h2>Caching<a class="headerlink" href="#caching" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Caravel uses <a class="reference external" href="https://pythonhosted.org/Flask-Cache/">Flask-Cache</a> for
|
||||
<p>Superset uses <a class="reference external" href="https://pythonhosted.org/Flask-Cache/">Flask-Cache</a> for
|
||||
caching purpose. Configuring your caching backend is as easy as providing
|
||||
a <code class="docutils literal"><span class="pre">CACHE_CONFIG</span></code>, constant in your <code class="docutils literal"><span class="pre">caravel_config.py</span></code> that
|
||||
a <code class="docutils literal"><span class="pre">CACHE_CONFIG</span></code>, constant in your <code class="docutils literal"><span class="pre">superset_config.py</span></code> that
|
||||
complies with the Flask-Cache specifications.</p>
|
||||
<p>Flask-Cache supports multiple caching backends (Redis, Memcached,
|
||||
SimpleCache (in-memory), or the local filesystem). If you are going to use
|
||||
Memcached please use the pylibmc client library as python-memcached does
|
||||
not handle storing binary data correctly. If you use Redis, please install
|
||||
[python-redis](<a class="reference external" href="https://pypi.python.org/pypi/redis">https://pypi.python.org/pypi/redis</a>).</p>
|
||||
<p>For setting your timeouts, this is done in the Caravel metadata and goes
|
||||
<p>For setting your timeouts, this is done in the Superset metadata and goes
|
||||
up the “timeout searchpath”, from your slice configuration, to your
|
||||
data source’s configuration, to your database’s and ultimately falls back
|
||||
into your global default defined in <code class="docutils literal"><span class="pre">CACHE_CONFIG</span></code>.</p>
|
||||
@@ -451,7 +452,7 @@ while the <code class="docutils literal"><span class="pre">metadata_params</span
|
||||
<h2>Schemas (Postgres & Redshift)<a class="headerlink" href="#schemas-postgres-redshift" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Postgres and Redshift, as well as other database,
|
||||
use the concept of <strong>schema</strong> as a logical entity
|
||||
on top of the <strong>database</strong>. For Caravel to connect to a specific schema,
|
||||
on top of the <strong>database</strong>. For Superset to connect to a specific schema,
|
||||
there’s a <strong>schema</strong> parameter you can set in the table form.</p>
|
||||
</div>
|
||||
<div class="section" id="ssl-access-to-databases">
|
||||
@@ -480,15 +481,15 @@ parameter</p>
|
||||
<code class="docutils literal"><span class="pre">Admin->Refresh</span> <span class="pre">Metadata</span></code> menu item to populate</li>
|
||||
<li>Navigate to your datasources</li>
|
||||
</ul>
|
||||
<p>Note that you can run the <code class="docutils literal"><span class="pre">caravel</span> <span class="pre">refresh_druid</span></code> command to refresh the
|
||||
<p>Note that you can run the <code class="docutils literal"><span class="pre">superset</span> <span class="pre">refresh_druid</span></code> command to refresh the
|
||||
metadata from your Druid cluster(s)</p>
|
||||
</div>
|
||||
<div class="section" id="cors">
|
||||
<h2>CORS<a class="headerlink" href="#cors" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The extra CORS Dependency must be installed:</p>
|
||||
<blockquote>
|
||||
<div>caravel[cors]</div></blockquote>
|
||||
<p>The following keys in <cite>caravel_config.py</cite> can be specified to configure CORS:</p>
|
||||
<div>superset[cors]</div></blockquote>
|
||||
<p>The following keys in <cite>superset_config.py</cite> can be specified to configure CORS:</p>
|
||||
<ul class="simple">
|
||||
<li><code class="docutils literal"><span class="pre">ENABLE_CORS</span></code>: Must be set to True in order to enable CORS</li>
|
||||
<li><code class="docutils literal"><span class="pre">CORS_OPTIONS</span></code>: options passed to Flask-CORS (<cite>documentation <http://flask-cors.corydolphin.com/en/latest/api.html#extension></cite>)</li>
|
||||
@@ -497,9 +498,9 @@ metadata from your Druid cluster(s)</p>
|
||||
<div class="section" id="upgrading">
|
||||
<h2>Upgrading<a class="headerlink" href="#upgrading" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Upgrading should be as straightforward as running:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">caravel</span> <span class="o">--</span><span class="n">upgrade</span>
|
||||
<span class="n">caravel</span> <span class="n">db</span> <span class="n">upgrade</span>
|
||||
<span class="n">caravel</span> <span class="n">init</span>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">superset</span> <span class="o">--</span><span class="n">upgrade</span>
|
||||
<span class="n">superset</span> <span class="n">db</span> <span class="n">upgrade</span>
|
||||
<span class="n">superset</span> <span class="n">init</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -508,33 +509,33 @@ metadata from your Druid cluster(s)</p>
|
||||
<p>SQL Lab is a powerful SQL IDE that works with all SQLAlchemy compatible
|
||||
databases out there. By default, queries are run in a web request, and
|
||||
may eventually timeout as queries exceed the maximum duration of a web
|
||||
request in your environment, whether it’d be a reverse proxy or the Caravel
|
||||
request in your environment, whether it’d be a reverse proxy or the Superset
|
||||
server itself.</p>
|
||||
<p>In the modern analytics world, it’s not uncommon to run large queries that
|
||||
run for minutes or hours.
|
||||
To enable support for long running queries that
|
||||
execute beyond the typical web request’s timeout (30-60 seconds), it is
|
||||
necessary to deploy an asynchronous backend, which consist of one or many
|
||||
Caravel worker, which is implemented as a Celery worker, and a Celery
|
||||
Superset worker, which is implemented as a Celery worker, and a Celery
|
||||
broker for which we recommend using Redis or RabbitMQ.</p>
|
||||
<p>It’s also preferable to setup an async result backend as a key value store
|
||||
that can hold the long-running query results for a period of time. More
|
||||
details to come as to how to set this up here soon.</p>
|
||||
<p>SQL Lab supports templating in queries, and it’s possible to override
|
||||
the default Jinja context in your environment by defining the
|
||||
<code class="docutils literal"><span class="pre">JINJA_CONTEXT_ADDONS</span></code> in your caravel configuration. Objects referenced
|
||||
<code class="docutils literal"><span class="pre">JINJA_CONTEXT_ADDONS</span></code> in your superset configuration. Objects referenced
|
||||
in this dictionary are made available for users to use in their SQL.</p>
|
||||
</div>
|
||||
<div class="section" id="making-your-own-build">
|
||||
<h2>Making your own build<a class="headerlink" href="#making-your-own-build" title="Permalink to this headline">¶</a></h2>
|
||||
<p>For more advanced users, you may want to build Caravel from sources. That
|
||||
<p>For more advanced users, you may want to build Superset from sources. That
|
||||
would be the case if you fork the project to add features specific to
|
||||
your environment.:</p>
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span># assuming $CARAVEL_HOME as the root of the repo
|
||||
cd $CARAVEL_HOME/caravel/assets
|
||||
<div class="highlight-default"><div class="highlight"><pre><span></span># assuming $SUPERSET_HOME as the root of the repo
|
||||
cd $SUPERSET_HOME/superset/assets
|
||||
npm install
|
||||
npm run prod
|
||||
cd $CARAVEL_HOME
|
||||
cd $SUPERSET_HOME
|
||||
python setup.py install
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -551,7 +552,7 @@ python setup.py install
|
||||
<a href="tutorial.html" class="btn btn-neutral float-right" title="Tutorial" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
|
||||
|
||||
<a href="index.html" class="btn btn-neutral" title="Caravel’s documentation" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
<a href="index.html" class="btn btn-neutral" title="Superset’s documentation" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Sphinx inventory version 2
|
||||
# Project: Caravel's documentation
|
||||
# Project: Superset's documentation
|
||||
# Version:
|
||||
# The remainder of this file is compressed using zlib.
|
||||
xÚ¥‘OkÃ0Åïþ†<EFBFBD>í”@¯½<C2AF>Ž<EFBFBD>B-»ÅVS'nm¹4ß~N”<4E>ì¦÷ÞO’ÿ(ðpC›ŸM}†ƒr5á<35>òÇ@nÅJ^𥲂\ÈpµŠüD•}x”™P¿·ç(ÉÃ<2®nçUH'§ÿ70Äâ<C384>Cµ<43>FË@z©<7A>’ÙBvF—Ë×¶G¸Nó$9}{Ù‰¬EßLóÞbæ<62>…(±6µÆ{¦ýh;´w™]·¥±~Þ„Xñ<™²XaMÐÞ/õJ‹:1oýaÇ„|’éÕŽ¦ŒžÇTNÿpÈK“
|
||||
xÚ‘AkÃ0…ïþ†<EFBFBD>í”@¯½<C2AF><EFBFBD><EFBFBD>A--»'VSÇN-y4ÿ~Iä<49>vØ`7é½ÏO²<4F>±<EFBFBD>€@ùŸ‹:–ÞÜ(ß@ò¨«¶Á—€èƒlÚui¢\I¼Z«ŠüLµ½»—™À?%å}‡tlT CÆ»>º:{ýoÙ‹_æë<10>–Hz})³•„Á—/})Nê:÷»–Ý×§<C397>¨”µÚ¹Ÿ$fÞ¸8ã4ܰ›v@“Êì{_Š Ky3bŸÞâegÆ©þ‚Ý!¤nÒÐ,ÏNú8dF>ÈgïN¦Š<C2A6>cj¯Ø²i³ÑàŒ¯£…´/‚
|
||||
åyy‚µ´3û[UAÇ–1Z<ר<C397>4w‚¿iN'÷»<C3B7>ܨBP$Œ²snÔ˜<¤N|
|
||||
11
search.html
11
search.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Search — Caravel's documentation documentation</title>
|
||||
<title>Search — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="#"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
|
||||
|
||||
<script src="_static/js/modernizr.min.js"></script>
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -115,6 +115,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -163,7 +164,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Security — Caravel's documentation documentation</title>
|
||||
<title>Security — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="SQL Lab" href="sqllab.html"/>
|
||||
<link rel="prev" title="Tutorial" href="tutorial.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -196,13 +197,13 @@
|
||||
|
||||
<div class="section" id="security">
|
||||
<h1>Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Security in Caravel is handled by Flask AppBuilder (FAB). FAB is a
|
||||
<p>Security in Superset is handled by Flask AppBuilder (FAB). FAB is a
|
||||
“Simple and rapid application development framework, built on top of Flask.”.
|
||||
FAB provides authentication, user management, permissions and roles.</p>
|
||||
<div class="section" id="provided-roles">
|
||||
<h2>Provided Roles<a class="headerlink" href="#provided-roles" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Caravel ships with 3 roles that are handled by Caravel itself. You can
|
||||
assume that these 3 roles will stay up-to-date as Caravel evolves.</p>
|
||||
<p>Superset ships with 3 roles that are handled by Superset itself. You can
|
||||
assume that these 3 roles will stay up-to-date as Superset evolves.</p>
|
||||
<div class="section" id="admin">
|
||||
<h3>Admin<a class="headerlink" href="#admin" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Admins have all possible rights, including granting or revoking rights from
|
||||
@@ -245,14 +246,14 @@ and use the typeahead to search for your table names.</p>
|
||||
<p>The permissions exposed by FAB are very granular and allow for a great level
|
||||
of customization. FAB creates many permissions automagically for each model
|
||||
that is create (can_add, can_delete, can_show, can_edit, ...) as well as for
|
||||
each view. On top of that, Caravel can expose more granular permissions like
|
||||
each view. On top of that, Superset can expose more granular permissions like
|
||||
<code class="docutils literal"><span class="pre">all_datasource_access</span></code>.</p>
|
||||
<p>We do not recommend altering the 3 base roles as there
|
||||
are a set of assumptions that Caravel build upon. It is possible though for
|
||||
are a set of assumptions that Superset build upon. It is possible though for
|
||||
you to create your own roles, and union them to existing ones.</p>
|
||||
<div class="section" id="permissions">
|
||||
<h3>Permissions<a class="headerlink" href="#permissions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Roles are composed of a set of permissions, and Caravel has many categories
|
||||
<p>Roles are composed of a set of permissions, and Superset has many categories
|
||||
of permissions. Here are the different categories of permissions:</p>
|
||||
<ul class="simple">
|
||||
<li><strong>Model & action</strong>: models are entities like <code class="docutils literal"><span class="pre">Dashboard</span></code>,
|
||||
|
||||
36
sqllab.html
36
sqllab.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>SQL Lab — Caravel's documentation documentation</title>
|
||||
<title>SQL Lab — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="Videos" href="videos.html"/>
|
||||
<link rel="prev" title="Security" href="security.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -205,7 +206,7 @@
|
||||
</li>
|
||||
<li><p class="first">A multi-tab environment to work on multiple queries at a time</p>
|
||||
</li>
|
||||
<li><p class="first">A smooth flow to visualize your query results using Caravel’s rich
|
||||
<li><p class="first">A smooth flow to visualize your query results using Superset’s rich
|
||||
visualization capabilities</p>
|
||||
</li>
|
||||
<li><p class="first">Browse database metadata: tables, columns, indexes, partitions</p>
|
||||
@@ -227,11 +228,17 @@ which allows for using macros in your SQL code</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="extra-features">
|
||||
<h2>Extra features<a class="headerlink" href="#extra-features" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Hit <code class="docutils literal"><span class="pre">alt</span> <span class="pre">+</span> <span class="pre">enter</span></code> as a keyboard shortcut to run your query</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="templating-with-jinja">
|
||||
<h2>Templating with Jinja<a class="headerlink" href="#templating-with-jinja" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="highlight-sql"><div class="highlight"><pre><span></span><span class="k">SELECT</span> <span class="o">*</span>
|
||||
<span class="k">FROM</span> <span class="n">some_table</span>
|
||||
<span class="k">WHERE</span> <span class="n">partition_key</span> <span class="o">=</span> <span class="s1">'{{ preto.latest_partition('</span><span class="n">some_table</span><span class="s1">') }}'</span>
|
||||
<span class="k">WHERE</span> <span class="n">partition_key</span> <span class="o">=</span> <span class="s1">'{{ presto.latest_partition('</span><span class="n">some_table</span><span class="s1">') }}'</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Templating unleashes the power and capabilities of a
|
||||
@@ -241,22 +248,23 @@ parameterized so they can be re-used easily.</p>
|
||||
<div class="section" id="available-macros">
|
||||
<h3>Available macros<a class="headerlink" href="#available-macros" title="Permalink to this headline">¶</a></h3>
|
||||
<p>We expose certain modules from Python’s standard library in
|
||||
Caravel’s Jinja context:
|
||||
Superset’s Jinja context:
|
||||
- <code class="docutils literal"><span class="pre">time</span></code>: <code class="docutils literal"><span class="pre">time</span></code>
|
||||
- <code class="docutils literal"><span class="pre">datetime</span></code>: <code class="docutils literal"><span class="pre">datetime.datetime</span></code>
|
||||
- <code class="docutils literal"><span class="pre">uuid</span></code>: <code class="docutils literal"><span class="pre">uuid</span></code>
|
||||
- <code class="docutils literal"><span class="pre">random</span></code>: <code class="docutils literal"><span class="pre">random</span></code>
|
||||
- <code class="docutils literal"><span class="pre">relativedelta</span></code>: <code class="docutils literal"><span class="pre">dateutil.relativedelta.relativedelta</span></code>
|
||||
- more to come!</p>
|
||||
<p><a class="reference external" href="http://jinja.pocoo.org/docs/dev/templates/">Jinja’s builtin filters</a> can be also be applied where needed.</p>
|
||||
<dl class="class">
|
||||
<dt id="caravel.jinja_context.PrestoContext">
|
||||
<em class="property">class </em><code class="descclassname">caravel.jinja_context.</code><code class="descname">PrestoContext</code><span class="sig-paren">(</span><em>database</em>, <em>query</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/caravel/jinja_context.html#PrestoContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#caravel.jinja_context.PrestoContext" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="superset.jinja_context.PrestoTemplateProcessor">
|
||||
<em class="property">class </em><code class="descclassname">superset.jinja_context.</code><code class="descname">PrestoTemplateProcessor</code><span class="sig-paren">(</span><em>database=None</em>, <em>query=None</em>, <em>table=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/superset/jinja_context.html#PrestoTemplateProcessor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#superset.jinja_context.PrestoTemplateProcessor" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Presto Jinja context</p>
|
||||
<p>The methods described here are namespaced under <code class="docutils literal"><span class="pre">presto</span></code> in the
|
||||
jinja context as in <code class="docutils literal"><span class="pre">SELECT</span> <span class="pre">'{{</span> <span class="pre">presto.some_macro_call()</span> <span class="pre">}}'</span></code></p>
|
||||
<dl class="method">
|
||||
<dt id="caravel.jinja_context.PrestoContext.latest_partition">
|
||||
<code class="descname">latest_partition</code><span class="sig-paren">(</span><em>table_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/caravel/jinja_context.html#PrestoContext.latest_partition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#caravel.jinja_context.PrestoContext.latest_partition" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="superset.jinja_context.PrestoTemplateProcessor.latest_partition">
|
||||
<code class="descname">latest_partition</code><span class="sig-paren">(</span><em>table_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/superset/jinja_context.html#PrestoTemplateProcessor.latest_partition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#superset.jinja_context.PrestoTemplateProcessor.latest_partition" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the latest (max) partition value for a table</p>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@@ -274,8 +282,8 @@ name or a fully qualified table name as <code class="docutils literal"><span cla
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
<dt id="caravel.jinja_context.PrestoContext.latest_sub_partition">
|
||||
<code class="descname">latest_sub_partition</code><span class="sig-paren">(</span><em>table_name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/caravel/jinja_context.html#PrestoContext.latest_sub_partition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#caravel.jinja_context.PrestoContext.latest_sub_partition" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="superset.jinja_context.PrestoTemplateProcessor.latest_sub_partition">
|
||||
<code class="descname">latest_sub_partition</code><span class="sig-paren">(</span><em>table_name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/superset/jinja_context.html#PrestoTemplateProcessor.latest_sub_partition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#superset.jinja_context.PrestoTemplateProcessor.latest_sub_partition" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the latest (max) partition value for a table</p>
|
||||
<p>A filtering criteria should be passed for all fields that are
|
||||
partitioned except for the field to be returned. For example,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Tutorial — Caravel's documentation documentation</title>
|
||||
<title>Tutorial — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="Security" href="security.html"/>
|
||||
<link rel="prev" title="Installation & Configuration" href="installation.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -198,7 +199,7 @@
|
||||
<h1>Tutorial<a class="headerlink" href="#tutorial" title="Permalink to this headline">¶</a></h1>
|
||||
<p>This basic linear tutorial will take you through connecting to a database,
|
||||
adding a table, creating a slice and a dashboard. First you’ll need to tell
|
||||
Caravel where to find the database you want to
|
||||
Superset where to find the database you want to
|
||||
query. First go to the database menu</p>
|
||||
<a class="reference internal image-reference" href="_images/db_menu.png"><img alt="_images/db_menu.png" src="_images/db_menu.png" style="width: 151.2px; height: 104.4px;" /></a>
|
||||
<p>Now click on the <code class="docutils literal"><span class="pre">+</span></code> button to add a new entry</p>
|
||||
@@ -214,16 +215,16 @@ using the navigation bar at the top to <code class="docutils literal"><span clas
|
||||
plus (<code class="docutils literal"><span class="pre">+</span></code>) sign there (similar to the one ).</p>
|
||||
<p>Now enter the name of the table in the <code class="docutils literal"><span class="pre">Table</span> <span class="pre">Name</span></code> textbox, and select
|
||||
the database you just created in the <code class="docutils literal"><span class="pre">Database</span></code> dropdown, hit save. At this
|
||||
moment, Caravel fetched the column names, their data types and tries to guess
|
||||
moment, Superset fetched the column names, their data types and tries to guess
|
||||
which fields are metrics in dimensions. From the list view, edit the table
|
||||
that you just created by clicking the tiny pen icon.</p>
|
||||
<a class="reference internal image-reference" href="_images/pen.png"><img alt="_images/pen.png" src="_images/pen.png" style="width: 130.2px; height: 39.0px;" /></a>
|
||||
<p>Now you’re in the table editor, click on the “List Table Column” tab,
|
||||
showing you the list of columns in your table as well as their data types.</p>
|
||||
<a class="reference internal image-reference" href="_images/matrix.png"><img alt="_images/matrix.png" src="_images/matrix.png" style="width: 652.8px; height: 287.4px;" /></a>
|
||||
<p>Click the checkboxes here that inform Caravel how your columns should be
|
||||
<p>Click the checkboxes here that inform Superset how your columns should be
|
||||
shown in the explore view, and which metrics should be created. Make sure
|
||||
to inform Caravel about your date columns. You could also create
|
||||
to inform Superset about your date columns. You could also create
|
||||
“SQL expression” columns here, or metrics in that tab as aggregate expressions,
|
||||
but let’s not do that just yet. Hit <code class="docutils literal"><span class="pre">save</span></code>.</p>
|
||||
<p>You should now be back in the <code class="docutils literal"><span class="pre">Table</span> <span class="pre">List</span></code> view. Click on the name of the
|
||||
|
||||
17
videos.html
17
videos.html
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Videos — Caravel's documentation documentation</title>
|
||||
<title>Videos — Superset's documentation documentation</title>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<link rel="index" title="Index"
|
||||
href="genindex.html"/>
|
||||
<link rel="search" title="Search" href="search.html"/>
|
||||
<link rel="top" title="Caravel's documentation documentation" href="index.html"/>
|
||||
<link rel="top" title="Superset's documentation documentation" href="index.html"/>
|
||||
<link rel="next" title="Gallery" href="gallery.html"/>
|
||||
<link rel="prev" title="SQL Lab" href="sqllab.html"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
|
||||
<a href="index.html" class="icon icon-home"> Caravel's documentation
|
||||
<a href="index.html" class="icon icon-home"> Superset's documentation
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#os-dependencies">OS dependencies</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-virtualenv">Python virtualenv</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#python-s-setup-tools-and-pip">Python’s setup tools and pip</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#caravel-installation-and-initialization">Caravel installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#superset-installation-and-initialization">Superset installation and initialization</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration-behind-a-load-balancer">Configuration behind a load balancer</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#configuration">Configuration</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="installation.html#database-dependencies">Database dependencies</a></li>
|
||||
@@ -117,6 +117,7 @@
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="sqllab.html">SQL Lab</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#feature-overview">Feature Overview</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#extra-features">Extra features</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="sqllab.html#templating-with-jinja">Templating with Jinja</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="sqllab.html#available-macros">Available macros</a></li>
|
||||
</ul>
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">Caravel's documentation</a>
|
||||
<a href="index.html">Superset's documentation</a>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -197,10 +198,10 @@
|
||||
<div class="section" id="videos">
|
||||
<h1>Videos<a class="headerlink" href="#videos" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Here is a collection of short videos showing different aspect
|
||||
of Caravel.</p>
|
||||
of Superset.</p>
|
||||
<div class="section" id="quick-intro">
|
||||
<h2>Quick Intro<a class="headerlink" href="#quick-intro" title="Permalink to this headline">¶</a></h2>
|
||||
<p>This video demonstrates how Caravel works at a high level, it shows how
|
||||
<p>This video demonstrates how Superset works at a high level, it shows how
|
||||
to navigate through datasets and dashboards that are already available.</p>
|
||||
<iframe width="640" height="360" src="//www.youtube.com/embed/3Txm_nj_R7M?feature=player_detailpage" frameborder="0" allowfullscreen="1"> </iframe></div>
|
||||
<div class="section" id="dashboard-creation">
|
||||
@@ -237,7 +238,7 @@ to toggle them on dashboards.</p>
|
||||
</div>
|
||||
<div class="section" id="adding-a-table">
|
||||
<h2>Adding a Table<a class="headerlink" href="#adding-a-table" title="Permalink to this headline">¶</a></h2>
|
||||
<p>This videos shows you how to expose a new table in Caravel, and how to
|
||||
<p>This videos shows you how to expose a new table in Superset, and how to
|
||||
define the semantics on how this can be accessed by others in the <code class="docutils literal"><span class="pre">Explore</span></code>
|
||||
and <code class="docutils literal"><span class="pre">Dashboard</span></code> views.</p>
|
||||
<ul class="simple">
|
||||
|
||||
Reference in New Issue
Block a user