You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ad...@apache.org on 2015/02/26 02:16:45 UTC

svn commit: r1662344 [3/8] - in /drill/site/trunk/content/drill: ./ blog/2014/12/11/apache-drill-qa-panelist-spotlight/ docs/ docs/2014-q1-drill-report/ docs/advanced-properties/ docs/analyzing-yelp-json-data-with-apache-drill/ docs/apache-drill-0-6-0-...

Modified: drill/site/trunk/content/drill/docs/explain-commands/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/explain-commands/index.html?rev=1662344&r1=1662343&r2=1662344&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/explain-commands/index.html (original)
+++ drill/site/trunk/content/drill/docs/explain-commands/index.html Thu Feb 26 01:16:43 2015
@@ -91,7 +91,7 @@ conditions against the same data will re
 change a configuration option, for example, or update the tables or files that
 you are selecting from, you are likely to see plan changes.</p>
 
-<h1 id="explain-syntax">EXPLAIN Syntax</h1>
+<h2 id="explain-syntax">EXPLAIN Syntax</h2>
 
 <p>The EXPLAIN command supports the following syntax:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">explain plan [ including all attributes ] [ with implementation | without implementation ] for &lt;query&gt; ;
@@ -108,7 +108,7 @@ physical and logical plans.</p>
 <p>These options return the physical and logical plan information, respectively.
 The default is physical (WITH IMPLEMENTATION).</p>
 
-<h1 id="explain-for-physical-plans">EXPLAIN for Physical Plans</h1>
+<h2 id="explain-for-physical-plans">EXPLAIN for Physical Plans</h2>
 
 <p>The EXPLAIN PLAN FOR <query> command returns the chosen physical execution
 plan for a query statement without running the query. You can use this command
@@ -173,7 +173,7 @@ for submitting the query via Drill APIs.
   },
 ....
 </code></pre></div>
-<h1 id="costing-information">Costing Information</h1>
+<h2 id="costing-information">Costing Information</h2>
 
 <p>Add the INCLUDING ALL ATTRIBUTES option to the EXPLAIN command to see cost
 estimates for the query plan. For example:</p>
@@ -192,7 +192,7 @@ select * from dfs.`/Users/brumsby/drill/
 00-04            ProducerConsumer: rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io, 0.0 network}, id = 3106
 00-05              Scan(groupscan=[EasyGroupScan [selectionRoot=/Users/brumsby/drill/donuts.json, columns = null]]): rowcount = 1.0, cumulative cost = {0.0 rows, 0.0 cpu, 0.0 io, 0.0 network}, id = 3101
 </code></pre></div>
-<h1 id="explain-for-logical-plans">EXPLAIN for Logical Plans</h1>
+<h2 id="explain-for-logical-plans">EXPLAIN for Logical Plans</h2>
 
 <p>To return the logical plan for a query (again, without actually running the
 query), use the EXPLAIN PLAN WITHOUT IMPLEMENTATION syntax:</p>

Modified: drill/site/trunk/content/drill/docs/flatten-function/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/flatten-function/index.html?rev=1662344&r1=1662343&r2=1662344&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/flatten-function/index.html (original)
+++ drill/site/trunk/content/drill/docs/flatten-function/index.html Thu Feb 26 01:16:43 2015
@@ -143,7 +143,7 @@ order by count(celltbl.catl) desc limit
 +---------------|------------+
 </code></pre></div>
 <p>A common use case for FLATTEN is its use in conjunction with the
-<a href="/confluence/display/DRILL/KVGEN+Function">KVGEN</a> function.</p>
+<a href="/drill/docs/flatten-function">KVGEN</a> function.</p>
 </div>
 
 

Modified: drill/site/trunk/content/drill/docs/flexibility/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/flexibility/index.html?rev=1662344&r1=1662343&r2=1662344&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/flexibility/index.html (original)
+++ drill/site/trunk/content/drill/docs/flexibility/index.html Thu Feb 26 01:16:43 2015
@@ -69,7 +69,7 @@
 
 <div class="int_text" align="left"><p>The following features contribute to Drill&#39;s flexible architecture:</p>
 
-<p><strong>_Dynamic schema discovery _</strong></p>
+<p><strong><em>Dynamic schema discovery</em></strong></p>
 
 <p>Drill does not require schema or type specification for the data in order to
 start the query execution process. Instead, Drill starts processing the data
@@ -121,7 +121,7 @@ traditional DB (Databases-&gt;Tables/Vie
 through the ANSI standard INFORMATION_SCHEMA database</p>
 
 <p>For more information on how to configure and work various data sources with
-Drill, refer to <a href="https://cwiki.apache.or%0Ag/confluence/display/DRILL/Connect+Apache+Drill+to+Data+Sources">Connect Apache Drill to Data Sources</a>.</p>
+Drill, refer to <a href="/drill/docs/connect-to-data-sources">Connect Apache Drill to Data Sources</a>.</p>
 
 <p><strong><em>Extensibility</em></strong></p>
 

Modified: drill/site/trunk/content/drill/docs/getting-to-know-the-drill-sandbox/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/getting-to-know-the-drill-sandbox/index.html?rev=1662344&r1=1662343&r2=1662344&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/getting-to-know-the-drill-sandbox/index.html (original)
+++ drill/site/trunk/content/drill/docs/getting-to-know-the-drill-sandbox/index.html Thu Feb 26 01:16:43 2015
@@ -82,7 +82,7 @@ optimization rules for Drill to leverage
 
 <p>Take a look at the pre-configured storage plugins by opening the Drill Web UI.</p>
 
-<p>Feel free to skip this section and jump directly to the queries: <a href="/confluence/display/DRILL/Lesson+1%3A+Learn+About+the+Data+Set">Lesson 1:
+<p>Feel free to skip this section and jump directly to the queries: <a href="/drill/docs/lession-1-learn-about-the-data-set">Lesson 1:
 Learn About the Data
 Set</a></p>
 
@@ -97,8 +97,7 @@ Set</a></p>
 
 <p>A storage plugin configuration for MapR-DB in the sandbox. Drill uses a single
 storage plugin for connecting to HBase as well as MapR-DB, which is an
-enterprise grade in-Hadoop NoSQL database. See the <a href="https://cwiki.apache.org/confluence/display/DRILL/Registering+HBase">Apache Drill
-Wiki</a> for
+enterprise grade in-Hadoop NoSQL database. In addition to the following brief example, see the <a href="/drill/docs/registering-hbase">Registering HBase</a> for more
 information on how to configure Drill to query HBase.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">{
   &quot;type&quot; : &quot;hbase&quot;,
@@ -132,7 +131,7 @@ create as many workspaces as they need w
 <p>Each workspace can also be configured as “writable” or not, which indicates
 whether users can write data to this location and defines the storage format
 in which the data will be written (parquet, csv, json). These attributes
-become relevant when you explore Drill SQL commands, especially CREATE TABLE
+become relevant when you explore SQL commands, especially CREATE TABLE
 AS (CTAS) and CREATE VIEW.</p>
 
 <p>Drill can query files and directories directly and can detect the file formats
@@ -216,8 +215,8 @@ connect and access from Drill. The inter
 <h3 id="odbc/jdbc-drivers">ODBC/JDBC drivers</h3>
 
 <p>Drill provides ODBC/JDBC drivers to connect from BI tools such as Tableau,
-MicroStrategy, SQUirrel, and Jaspersoft; refer to <a href="http://doc.mapr.com/display/MapR/Using+ODBC+to+Access+Apa%0Ache+Drill+from+BI+Tools">Using ODBC to Access Apache
-Drill from BI Tools</a> and <a href="http://doc.ma%0Apr.com/display/MapR/Using+JDBC+to+Access+Apache+Drill+from+SQuirreL">Using JDBC to Access Apache Drill</a> to learn
+MicroStrategy, SQUirrel, and Jaspersoft; refer to <a href="/drill/docs/odbc-jdbc-interfaces/using-odbc-to-%20access-apache-drill-from-bi-tools">Using ODBC to Access Apache
+Drill from BI Tools</a> and <a href="/drill/docs/odbc-jdbc-interfaces#using-jdbc-to-access-apache-drill-from-squirrel">Using JDBC to Access Apache Drill</a> to learn
 more.</p>
 
 <h3 id="sqlline">SQLLine</h3>
@@ -254,7 +253,7 @@ tutorial.</p>
 submit queries to Drill and observe results. Here is a screen shot of the Web
 UI for Apache Drill:</p>
 
-<p><img src="../../img/DrillWebUI.png" alt="">  </p>
+<p><img src="/docs/img/DrillWebUI.png" alt="drill query flow"></p>
 
 <h3 id="rest-api">REST API</h3>
 
@@ -293,7 +292,7 @@ Apache Drill as you work through the tut
 
 <h1 id="what&#39;s-next">What&#39;s Next</h1>
 
-<p>Start running queries by going to <a href="/confluence/display/DRILL/Lesson+1%3A+Learn+About+the+Data+Set">Lesson 1: Learn About the Data
+<p>Start running queries by going to <a href="/drill/docs/lession-1-learn-about-the-data-set">Lesson 1: Learn About the Data
 Set</a>.</p>
 </div>
 

Modified: drill/site/trunk/content/drill/docs/how-to-run-the-drill-demo/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/how-to-run-the-drill-demo/index.html?rev=1662344&r1=1662343&r2=1662344&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/how-to-run-the-drill-demo/index.html (original)
+++ drill/site/trunk/content/drill/docs/how-to-run-the-drill-demo/index.html Thu Feb 26 01:16:43 2015
@@ -67,46 +67,294 @@
 
 </div>
 
-<div class="int_text" align="left"><h3 id="what-is-apache-drill">What is Apache Drill</h3>
+<div class="int_text" align="left"><h1 id="how-to-run-the-drill-demo">How To Run the Drill Demo</h1>
 
-<p>Apache Drill by Apache Foundation is the first open source implementation of
-the Google&#39;s Dremel paper for interactive query processing. Apache Drill
-provides low latency ad-hoc queries to many different data sources &amp; nested
-data. Drill is designed to scale to 10,000 servers and query petabytes of data
-in seconds.</p>
+<p>This section describes how to get started by running the Drill demo.</p>
 
-<p><img src="../../img/drill2.png" alt=""></p>
-
-<p>In a nutshell, Few key points about Apache Drill are:</p>
+<h2 id="pre-requisites">Pre-requisites</h2>
 
 <ul>
-<li>Inspired by Google&#39;s Dremel</li>
-<li>Supports standard SQL 2003</li>
-<li>Supports plug-able data sources (HBase, Mongo, HDFS etc)</li>
-<li>Supports nested data (JSON, ProtoBufs, Parquet etc)</li>
-<li>Supports optional schema</li>
-<li>Community driven</li>
+<li><p>Maven 2 or higher</p>
+
+<p>On Ubuntu, you can do this as root:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">apt-get install maven2
+</code></pre></div>
+<p>On the Mac, maven is pre-installed.</p>
+
+<p>Note that installing maven can result in installing java 1.6 and setting that
+to your default version. Make sure you check java version before compiling or
+running.</p></li>
+<li><p>Java 1.7</p>
+
+<p>You will need java 1.7 to compile and run the Drill demo.</p>
+
+<p>On Ubuntu you can get the right version of Java by doing this as root:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">apt-get install openjdk-7-jdk
+sudo update-alternatives --set java $(update-alternatives --list java | grep 7 | head -1)
+</code></pre></div>
+<p>On a Mac, go to <a href="http://www.oracle.com/technetwork/java/javase/downloads/java-se-%0Ajdk-7-download-432154.html">Oracle&#39;s web-
+site</a> to download and install java 7. You will also need
+to set JAVA_HOME in order to use the right version of java.</p>
+
+<p>Drill will not compile correctly using java 6. There is also a subtle problem
+that can occur if you have both<br>
+java 6 and java 7 with the default version set to 6. In that case, you may be
+able to compile, but execution may not work correctly.</p>
+
+<p>Send email to the dev list if this is a problem for you.</p></li>
+<li><p>Protobuf</p>
+
+<p>Drill requires Protobuf 2.5. Install this on Ubuntu using:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">apt-get install protobuf-compiler
+</code></pre></div>
+<p>On Centos 6.4, OEL or RHEL you will need to compile protobuf-compiler:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">wget http://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2
+tar xfj protobuf-2.5.0.tar.bz2
+pushd protobuf-2.5.0
+./configure
+make
+sudo make install
+</code></pre></div></li>
+<li><p>git</p>
+
+<p>On Ubuntu you can install git by doing this as root:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">apt-get install git-all
+</code></pre></div></li>
 </ul>
 
-<h3 id="where-apache-drill-fits-in">Where Apache Drill fits in</h3>
+<p>On the Mac or Windows, go to <a href="http://git-scm.com/downloads">this site</a> to
+download and install git.</p>
+
+<h2 id="check-your-installation-versions">Check your installation versions</h2>
 
-<p>Apache Drill is designed as an answer to the Interactive queries problems that
-we face while dealing with huge data. A standard Drill Query might take 100ms
-- 3 minutes for its execution as compared to Apache Hadoop or HIVE/PIG. Below
-is a diagram to help you relate in terms of the execution times:</p>
+<p>Run</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">java -version
+mvn -version
+</code></pre></div>
+<p>Verify that your default java and maven versions are correct, and that maven
+runs the right version of java. On my Mac, you see something like this:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">ted:apache-drill-1.0.0-m1$ java -version
+java version &quot;1.7.0_11&quot;
+Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
+Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
+ted:apache-drill-1.0.0-m1$ mvn -version
+Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
+Maven home: /usr/share/maven
+Java version: 1.7.0_11, vendor: Oracle Corporation
+Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/jre
+Default locale: en_US, platform encoding: UTF-8
+OS name: &quot;mac os x&quot;, version: &quot;10.7.5&quot;, arch: &quot;x86_64&quot;, family: &quot;mac&quot;
+ted:apache-drill-1.0.0-m1$
+</code></pre></div>
+<h2 id="get-the-source">Get the Source</h2>
+<div class="highlight"><pre><code class="language-text" data-lang="text">git clone https://git-wip-us.apache.org/repos/asf/incubator-drill.git
+</code></pre></div>
+<h2 id="compile-the-code">Compile the Code</h2>
+<div class="highlight"><pre><code class="language-text" data-lang="text">cd incubator-drill/sandbox/prototype
+mvn clean install -DskipTests
+rm .classpath
+</code></pre></div>
+<p>This takes about a minute on a not-terribly-current MacBook.</p>
+
+<h2 id="run-the-interactive-drill-shell">Run the interactive Drill shell</h2>
+<div class="highlight"><pre><code class="language-text" data-lang="text">./sqlline -u jdbc:drill:schema=parquet-local -n admin -p admin
+</code></pre></div>
+<p>The first time you run this program, you will get reams of output. What is
+happening is that the program is running maven in order to build a
+(voluminous) class path for the actual program and stores this classpath into
+the file called <code>.classpath</code>. When you run this program again, it will note
+that this file already exists and avoid re-creating it. You should delete this
+file every time the dependencies of Drill are changed. If you start getting
+&quot;class not found&quot; errors, that is a good hint that <code>.classpath</code> is out of date
+and needs to be deleted and recreated.</p>
+
+<p>The <code>-u</code> argument to <a href="https://github.com/julianhyde/sqlline">sqlline</a> is a
+JDBC connection string that directs sqlline to connect to drill. The Drill
+JDBC driver currently includes enough smarts to run Drill in embedded mode so
+this command also effectively starts a local drill bit. The <code>schema=</code> part of
+the JDBC connection string causes Drill to consider the &quot;parquet-local&quot;
+storage engine to be default. Other storage engines can be specified. The list
+of supported storage engines can be found in the file
+<code>./sqlparser/src/main/resources/storage-engines.json</code>. Each storage engine
+specifies the format of the data and how to get the data. See the section
+below on &quot;Storage Engines&quot; for more detail.</p>
+
+<p>When you run sqlline, you should see something like this after quite a lot of
+log messages:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">Connected to: Drill (version 1.0)
+Driver: Apache Drill JDBC Driver (version 1.0)
+Autocommit status: true
+Transaction isolation: TRANSACTION_REPEATABLE_READ
+sqlline version ??? by Marc Prud&#39;hommeaux
+0: jdbc:drill:schema=parquet-local&gt;
+</code></pre></div>
+<p><strong>Tip:</strong> To quit sqlline at any time, type &quot;!quit&quot; at the prompt.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">0: jdbc:drill:schema=parquet-local&gt; !quit
+</code></pre></div>
+<h2 id="run-a-query">Run a Query</h2>
+
+<p>Once you have sqlline running you can now try out some queries:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">select * from &quot;sample-data/region.parquet&quot;;
+</code></pre></div>
+<p>You should see a number of debug messages and then something like this:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">+--------------------------------------------------------------------------------------------------------------------------------------------+
+|                                                                                  _MAP                                                      |
++--------------------------------------------------------------------------------------------------------------------------------------------+
+| {&quot;R_REGIONKEY&quot;:0,&quot;R_NAME&quot;:&quot;AFRICA&quot;,&quot;R_COMMENT&quot;:&quot;lar deposits. blithely final packages cajole. regular waters are final requests. regular a |
+| {&quot;R_REGIONKEY&quot;:1,&quot;R_NAME&quot;:&quot;AMERICA&quot;,&quot;R_COMMENT&quot;:&quot;hs use ironic, even requests. s&quot;}                                                         |
+| {&quot;R_REGIONKEY&quot;:2,&quot;R_NAME&quot;:&quot;ASIA&quot;,&quot;R_COMMENT&quot;:&quot;ges. thinly even pinto beans ca&quot;}                                                            |
+| {&quot;R_REGIONKEY&quot;:3,&quot;R_NAME&quot;:&quot;EUROPE&quot;,&quot;R_COMMENT&quot;:&quot;ly final courts cajole furiously final excuse&quot;}                                            |
+| {&quot;R_REGIONKEY&quot;:4,&quot;R_NAME&quot;:&quot;MIDDLE EAST&quot;,&quot;R_COMMENT&quot;:&quot;uickly special accounts cajole carefully blithely close requests. carefully final asy |
++--------------------------------------------------------------------------------------------------------------------------------------------+
+5 rows selected (1.103 seconds)
+</code></pre></div>
+<p>Drill has no idea what the structure of this
+file is in terms of what fields exist, but Drill does know that every record
+has a pseudo-field called <code>_MAP</code>. This field contains a map of all of the
+actual fields to values. When returned via JDBC, this fields is rendered as
+JSON since JDBC doesn&#39;t really understand maps.</p>
+
+<p>This can be made more readable by using a query like this:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">select _MAP[&#39;R_REGIONKEY&#39;] as region_key, _MAP[&#39;R_NAME&#39;] as name, _MAP[&#39;R_COMMENT&#39;] as comment
+from &quot;sample-data/region.parquet&quot;;
+</code></pre></div>
+<p>The output will look something like this:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">+-------------+--------------+---------------------------------------------------------------------------------------------------------------+
+| REGION_KEY  |     NAME     |                                                       COMMENT                                                 |
++-------------+--------------+---------------------------------------------------------------------------------------------------------------+
+| 0           | AFRICA       | lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are accordi |
+| 1           | AMERICA      | hs use ironic, even requests. s                                                                               |
+| 2           | ASIA         | ges. thinly even pinto beans ca                                                                               |
+| 3           | EUROPE       | ly final courts cajole furiously final excuse                                                                 |
+| 4           | MIDDLE EAST  | uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl  |
++-------------+--------------+---------------------------------------------------------------------------------------------------------------+
+</code></pre></div>
+<p>In upcoming versions, Drill will insert the <code>_MAP[ ... ]</code> goo and will also
+unwrap the contents of <code>_MAP</code> in results so that things seem much more like
+ordinary SQL. The reason that things work this way now is that SQL itself
+requires considerable type information for queries to be parsed and that
+information doesn&#39;t necessarily exist for all kinds of files, especially those
+with very flexible schemas. To avoid all these problems, Drill adopts the
+convention of the _MAP fields for all kinds of input.</p>
+
+<h2 id="a-note-before-you-continue">A Note Before You Continue</h2>
+
+<p>Drill currently supports a wide variety of queries. It currently also has a
+fair number of deficiencies in terms of the number of operators that are
+actually supported and exactly which expressions are passed through to the
+execution engine in the correct form for execution.</p>
 
-<p><img src="../../img/drill-runtime.png" alt=""></p>
+<p>These problems fall into roughly three categories,</p>
+
+<ul>
+<li><p>missing operators. Many operators have been implemented for only a subset of the types available in Drill. This will cause queries to work for some types of data, but not for others. This is particularly true for operators with many possible type signatures such as comparisons. This lack is being remedied at a fast pace so check back in frequently if you suspect this might be a problem.</p>
 
-<h3 id="drill-is-powerful">Drill is powerful</h3>
+<p>Missing operators will result in error messages like this:</p>
 
-<p>Below are few things that make Apache Drill really powerful:</p>
+<p><code>UnsupportedOperationException:[ Missing function implementation: compare_to
+(BIT-OPTIONAL, BIT-OPTIONAL) ]</code></p></li>
+<li><p>missing casts. The SQL parser currently has trouble producing a valid logical plan without sufficient type information. Ironically, this type information is often not necessary to the execution engine because Drill generates the code on the fly based on the types of the data it encounters as data are processed. Currently, the work-around is to cast fields in certain situations to give the parser enough information to proceed. This problem will be remedied soon, but probably not quite as quickly as the missing operators.</p>
+
+<p>The typical error message that indicates you need an additional cast looks
+like</p>
+
+<p><code>Cannot apply &#39;&gt;&#39; to arguments of type &#39;&lt;ANY&gt; &gt; &lt;CHAR(1)&gt;&#39;. Supported
+form(s): &#39;&lt;COMPARABLE_TYPE&gt; &gt; &lt;COMPARABLE_TYPE&gt;&#39;</code></p>
 
 <ul>
-<li><strong>Speed</strong>: Apache Drill uses an efficient columnar storage format, an optimistic execution engine and a cache-conscious memory layout. Coordination, query planning, optimization, scheduling, and execution are all distributed throughout nodes in a system to maximize parallelization. Apache Drill is blazing fast. Period.</li>
-<li><strong>Plug-able data sources</strong>: Apache drill brings in the support of pluggable data sources like HBase, Mongo, HDFS etc. It means that Drill will still work comfortably while your data is exploring new data stores.</li>
-<li><strong>Nested data</strong>: With the support for data sources like HBase, Cassandra, MongoDB etc, Drill allows interactive analysis on all of your data, including nested and schema-less forms. Drill also supports querying against nested data formats like JSON and Parquet.</li>
-<li><strong>Flexibility</strong>: Apache Dril strongly defined tiers and APIs for straightforward integration with a wide array of technologies.</li>
+<li>weak optimizer. The current optimizer that transforms the logical plan into a physical plan is not the fully-featured cost based optimizer that Optiq normally uses. This is because some of the transformations that are needed for Drill are not yet fully supported by Optiq. In order to allow end-to-end execution of queries, a deterministic peep-hole optimizer has been used instead. This optimizer cannot handle large plan transformations and so some queries cannot be transformed correctly from logical to physical plan. We expect that the necessary changes to the cost-based optimizer will allow it to be used in an upcoming release, but didn&#39;t want to delay the current release waiting for that to happen.</li>
+</ul></li>
 </ul>
+
+<h2 id="try-fancier-queries">Try Fancier Queries</h2>
+
+<p>This query does a join between two files:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT nations.name, regions.name FROM (
+  SELECT _MAP[&#39;N_REGIONKEY&#39;] as regionKey, _MAP[&#39;N_NAME&#39;] as name
+  FROM &quot;sample-data/nation.parquet&quot;) nations
+join (
+  SELECT _MAP[&#39;R_REGIONKEY&#39;] as regionKey, _MAP[&#39;R_NAME&#39;] as name
+  FROM &quot;sample-data/region.parquet&quot;) regions
+  on nations.regionKey = regions.regionKey
+  order by nations.name;
+</code></pre></div>
+<p>Notice the use of sub-queries to avoid the spread of the <code>_MAP</code> idiom.</p>
+
+<p>This query illustrates how a cast is currently necessary to make the parser
+happy:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT
+  _MAP[&#39;N_REGIONKEY&#39;] as regionKey,
+  _MAP[&#39;N_NAME&#39;] as name
+FROM
+  &quot;sample-data/nation.parquet&quot;
+WHERE
+  cast(_MAP[&#39;N_NAME&#39;] as varchar) IN (&#39;MOROCCO&#39;, &#39;MOZAMBIQUE&#39;);
+</code></pre></div>
+<p>Here are more queries that you can try.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">// count distinct
+SELECT count(distinct _MAP[&#39;N_REGIONKEY&#39;]) FROM &quot;sample-data/nation.parquet&quot;;
+
+// aliases
+SELECT
+  _MAP[&#39;N_REGIONKEY&#39;] as regionKey,
+  _MAP[&#39;N_NAME&#39;] as name
+FROM &quot;sample-data/nation.parquet&quot;;
+
+// order by
+SELECT
+  _MAP[&#39;N_REGIONKEY&#39;] as regionKey,
+  _MAP[&#39;N_NAME&#39;] as name
+FROM
+  &quot;sample-data/nation.parquet&quot;
+ORDER BY
+  _MAP[&#39;N_NAME&#39;] DESC;
+
+  // subquery order by
+select * from (
+SELECT
+  _MAP[&#39;N_REGIONKEY&#39;] as regionKey,
+  _MAP[&#39;N_NAME&#39;] as name
+FROM
+  &quot;sample-data/nation.parquet&quot;
+) as x
+ORDER BY
+  name DESC;
+
+  // String where
+SELECT
+  _MAP[&#39;N_REGIONKEY&#39;] as regionKey,
+  _MAP[&#39;N_NAME&#39;] as name
+FROM
+  &quot;sample-data/nation.parquet&quot;
+WHERE
+  cast(_MAP[&#39;N_NAME&#39;] as varchar) &gt; &#39;M&#39;;
+
+  // INNER Join + Order (parquet)
+SELECT n.name, r.name FROM
+(SELECT _MAP[&#39;N_REGIONKEY&#39;] as regionKey, _MAP[&#39;N_NAME&#39;] as name FROM &quot;sample-data/nation.parquet&quot;)n
+join (SELECT _MAP[&#39;R_REGIONKEY&#39;] as regionKey, _MAP[&#39;R_NAME&#39;] as name FROM &quot;sample-data/region.parquet&quot;)r
+using (regionKey);
+
+// INNER Join + Order (parquet)
+SELECT n.name, r.name FROM
+(SELECT _MAP[&#39;N_REGIONKEY&#39;] as regionKey, _MAP[&#39;N_NAME&#39;] as name FROM &quot;sample-data/nation.parquet&quot;)n
+join (SELECT _MAP[&#39;R_REGIONKEY&#39;] as regionKey, _MAP[&#39;R_NAME&#39;] as name FROM &quot;sample-data/region.parquet&quot;)r
+on n.regionKey = r.regionKey
+order by n.name;
+</code></pre></div>
+<h2 id="analyze-the-execution-of-queries">Analyze the Execution of Queries</h2>
+
+<p>Drill sends log events to a logback socket appender. This makes it easy to
+catch and filter these log events using a tool called Lilith. You can download
+<a href="http://www.huxhorn.de/">Lilith</a> and install it easily. A tutorial can be
+<a href="http://ekkescorner.wordpress.com/2009/09/05/osgi-logging-part-8%0A-viewing-log-events-lilith/">found here</a>. This is especially important if you find errors
+that you want to report back to the mailing list since Lilith will help you
+isolate the stack trace of interest.</p>
+
+<p>By default, Lilith uses a slightly lurid splash page based on a pre-Raphaelite
+image of the mythical Lilith. This is easily disabled if the image is not to
+your taste (or if your work-mates are not well-versed in Victorian views of
+Sumerian mythology).</p>
 </div>
 
 

Added: drill/site/trunk/content/drill/docs/img/58.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/58.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/58.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/BI_to_Drill_2.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/BI_to_Drill_2.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/BI_to_Drill_2.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/HbaseViewCreation0.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/HbaseViewCreation0.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/HbaseViewCreation0.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/HbaseViewDSN.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/HbaseViewDSN.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/HbaseViewDSN.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/Hbase_Browse.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/Hbase_Browse.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/Hbase_Browse.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/Hive_DSN.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/Hive_DSN.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/Hive_DSN.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_CustomSQL.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_CustomSQL.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_CustomSQL.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_HbasePreview2.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_HbasePreview2.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_HbasePreview2.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_HbaseView.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_HbaseView.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_HbaseView.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_HiveConnection.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_HiveConnection.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_HiveConnection.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_to_Drillbit.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_to_Drillbit.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_to_Drillbit.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ODBC_to_Quorum.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ODBC_to_Quorum.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ODBC_to_Quorum.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/Parquet_DSN.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/Parquet_DSN.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/Parquet_DSN.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/Parquet_Preview.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/Parquet_Preview.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/Parquet_Preview.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/RegionParquet_table.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/RegionParquet_table.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/RegionParquet_table.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/SelectHbaseView.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/SelectHbaseView.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/SelectHbaseView.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/Untitled.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/Untitled.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/Untitled.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/VoterContributions_hbaseview.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/VoterContributions_hbaseview.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/VoterContributions_hbaseview.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ngram_plugin.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ngram_plugin.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ngram_plugin.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/ngram_plugin2.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/ngram_plugin2.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/ngram_plugin2.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/settings.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/settings.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/settings.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: drill/site/trunk/content/drill/docs/img/student_hive.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/student_hive.png?rev=1662344&view=auto
==============================================================================
Binary file - no diff available.

Propchange: drill/site/trunk/content/drill/docs/img/student_hive.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream