mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
232 lines
13 KiB
HTML
232 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>FAQ — caravel documentation</title>
|
|
|
|
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/docs.css" type="text/css" />
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: './',
|
|
VERSION: '',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
|
|
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
|
|
<script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
|
|
<link rel="top" title="caravel documentation" href="index.html" />
|
|
<link rel="prev" title="Druid" href="druid.html" />
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
|
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
</head>
|
|
<body role="document">
|
|
|
|
<div id="navbar" class="navbar navbar-default ">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="index.html">
|
|
Caravel Documentation</a>
|
|
<span class="navbar-text navbar-version pull-left"><b></b></span>
|
|
</div>
|
|
|
|
<div class="collapse navbar-collapse nav-collapse">
|
|
<ul class="nav navbar-nav">
|
|
|
|
|
|
<li class="dropdown globaltoc-container">
|
|
<a role="button"
|
|
id="dLabelGlobalToc"
|
|
data-toggle="dropdown"
|
|
data-target="#"
|
|
href="index.html">Topics <b class="caret"></b></a>
|
|
<ul class="dropdown-menu globaltoc"
|
|
role="menu"
|
|
aria-labelledby="dLabelGlobalToc"><ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation & Configuration</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="videos.html">Videos</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="gallery.html">Gallery</a></li>
|
|
<li class="toctree-l1"><a class="reference internal" href="druid.html">Druid</a></li>
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">FAQ</a></li>
|
|
</ul>
|
|
</ul>
|
|
</li>
|
|
|
|
<li class="dropdown">
|
|
<a role="button"
|
|
id="dLabelLocalToc"
|
|
data-toggle="dropdown"
|
|
data-target="#"
|
|
href="#">Page <b class="caret"></b></a>
|
|
<ul class="dropdown-menu localtoc"
|
|
role="menu"
|
|
aria-labelledby="dLabelLocalToc"><ul>
|
|
<li><a class="reference internal" href="#">FAQ</a><ul>
|
|
<li><a class="reference internal" href="#can-i-query-join-multiple-tables-at-one-time">Can I query/join multiple tables at one time?</a></li>
|
|
<li><a class="reference internal" href="#how-big-can-my-data-source-be">How BIG can my data source be?</a></li>
|
|
<li><a class="reference internal" href="#how-do-i-create-my-own-visualization">How do I create my own visualization?</a></li>
|
|
<li><a class="reference internal" href="#why-are-my-queries-timing-out">Why are my queries timing out?</a></li>
|
|
<li><a class="reference internal" href="#why-is-the-map-not-visible-in-the-mapbox-visualization">Why is the map not visible in the mapbox visualization?</a></li>
|
|
<li><a class="reference internal" href="#how-to-add-dynamic-filters-to-a-dashboard">How to add dynamic filters to a dashboard?</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="hidden-sm"></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<form class="navbar-form navbar-right" action="search.html" method="get">
|
|
<div class="form-group">
|
|
<input type="text" name="q" class="form-control" placeholder="Search" />
|
|
</div>
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container mainbody">
|
|
|
|
<div class="section" id="faq">
|
|
<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
|
|
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
|
|
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
|
|
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
|
|
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>
|
|
</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>
|
|
<p>It can be gigantic! As mentioned above, the main criteria is whether your
|
|
database can execute queries and return results in a time frame that is
|
|
acceptable to your users. Many distributed databases out there can execute
|
|
queries that scan through terabytes in an interactive fashion.</p>
|
|
</div>
|
|
<div class="section" id="how-do-i-create-my-own-visualization">
|
|
<h2>How do I create my own visualization?<a class="headerlink" href="#how-do-i-create-my-own-visualization" title="Permalink to this headline">¶</a></h2>
|
|
<p>We are planning on making it easier to add new visualizations to the
|
|
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>
|
|
</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>
|
|
<p>If you are seeing timeouts (504 Gateway Time-out) when running queries,
|
|
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>
|
|
</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>
|
|
</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>
|
|
<p>It’s easy: use the <code class="docutils literal"><span class="pre">Filter</span> <span class="pre">Box</span></code> widget, build a slice, and add it to your
|
|
dashboard.</p>
|
|
<p>The <code class="docutils literal"><span class="pre">Filter</span> <span class="pre">Box</span></code> widget allows you to define a query to populate dropdowns
|
|
that can be use for filtering. To build the list of distinct values, we
|
|
run a query, and sort the result by the metric you provide, sorting
|
|
descending.</p>
|
|
<p>The widget also has a checkbox <code class="docutils literal"><span class="pre">Date</span> <span class="pre">Filter</span></code>, which enables time filtering
|
|
capabilities to your dashboard. After checking the box and refreshing, you’ll
|
|
see a <code class="docutils literal"><span class="pre">from</span></code> and a <code class="docutils literal"><span class="pre">to</span></code> dropdown show up.</p>
|
|
<p>But what about if you don’t want certain widgets to get filtered on your
|
|
dashboard? You can do that by editing your dashboard, and in the form,
|
|
edit the <code class="docutils literal"><span class="pre">JSON</span> <span class="pre">Metadata</span></code> field, more specifically the
|
|
<code class="docutils literal"><span class="pre">filter_immune_slices</span></code> key, that receives an array of sliceIds that should
|
|
never be affected by any dashboard level filtering.</p>
|
|
<p>..code:</p>
|
|
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
|
|
<span class="s2">"filter_immune_slices"</span><span class="p">:</span> <span class="p">[</span><span class="mi">324</span><span class="p">,</span> <span class="mi">65</span><span class="p">,</span> <span class="mi">92</span><span class="p">],</span>
|
|
<span class="s2">"expanded_slices"</span><span class="p">:</span> <span class="p">{},</span>
|
|
<span class="s2">"filter_immune_slice_fields"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="s2">"177"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"country_name"</span><span class="p">,</span> <span class="s2">"__from"</span><span class="p">,</span> <span class="s2">"__to"</span><span class="p">],</span>
|
|
<span class="s2">"32"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"__from"</span><span class="p">,</span> <span class="s2">"__to"</span><span class="p">]</span>
|
|
<span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>In the json blob above, slices 324, 65 and 92 won’t be affected by any
|
|
dashboard level filtering.</p>
|
|
<p>Now note the <code class="docutils literal"><span class="pre">filter_immune_slice_fields</span></code> key. This one allows you to
|
|
be more specific and define for a specific slice_id, which filter fields
|
|
should be disregarded.</p>
|
|
<p>Note the use of the <code class="docutils literal"><span class="pre">__from</span></code> and <code class="docutils literal"><span class="pre">__to</span></code> keywords, those are reserved
|
|
for dealing with the time boundary filtering mentioned above.</p>
|
|
<p>But what happens with filtering when dealing with slices coming from
|
|
different tables or databases? If the column name is shared, the filter will
|
|
be applied, it’s as simple as that.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<footer class="footer">
|
|
<div class="container">
|
|
<p class="pull-right">
|
|
<a href="#">Back to top</a>
|
|
|
|
</p>
|
|
<p>
|
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.<br/>
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html> |