blob: a22cde9585478e759e65c37fdee6b2e640fd3546 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="http://localhost:4000/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2017-03-27T08:08:23-05:00</updated><id>http://localhost:4000//</id><title type="html">Apache Quickstep (Incubating)</title><subtitle>Quickstep is a next-generation data processing platform designed for high-performance analytical queries.
</subtitle><entry><title type="html">Your First Query</title><link href="http://localhost:4000/guides/2016/12/10/FirstQuery.html" rel="alternate" type="text/html" title="Your First Query" /><published>2016-12-10T12:29:09-06:00</published><updated>2016-12-10T12:29:09-06:00</updated><id>http://localhost:4000/guides/2016/12/10/FirstQuery</id><content type="html" xml:base="http://localhost:4000/guides/2016/12/10/FirstQuery.html">&lt;p&gt;For this tutorial, I’m going to assume you’re running in a unix environment. If you’re having trouble building on Windows, try asking the dev community (&lt;a href=&quot;mailto:dev@quickstep.incubating.apache.org&quot;&gt;dev@quickstep.incubating.apache.org&lt;/a&gt;). You can also find a complete guide &lt;a href=&quot;https://github.com/cramja/incubator-quickstep/blob/master/BUILDING.md&quot;&gt;here in our documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you’re going to build Quickstep, you’ll first need to clone it from Github and initialize the submodules&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone https://github.com/apache/incubator-quickstep.git .
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;incubator-quickstep
git submodule init
git submodule update&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Next, you’ll need to generate Makefiles using CMake, a cross-platform build tool that’s popular for building c++ projects. You’ll need a version at least as new as &lt;strong&gt;2.8.6&lt;/strong&gt;. (You can check with &lt;code class=&quot;highlighter-rouge&quot;&gt;cmake -v&lt;/code&gt;). If you have a later version, try generating the Makefiles like&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;build
cmake -DCMAKE_BUILD_TYPE&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Debug ..&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Note the weird flag &lt;code class=&quot;highlighter-rouge&quot;&gt;-DCMAKE_BUILD_TYPE=Debug&lt;/code&gt;. This is telling cmake to use, you guessed it, a debug configuration for the build. This automatically includes flags in the generated Makefiles to include debug symbols and turn on optional checks and log statements in the code. There’s tons more flags, but only a few which we commonly use. Mostly I just change the &lt;code class=&quot;highlighter-rouge&quot;&gt;CMAKE_CXX_COMPILER&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;CMAKE_C_COMPILER&lt;/code&gt;. These flags control the compiler and I prefer clang++ and clang.&lt;/p&gt;
&lt;p&gt;If cmake ran successfully you can now build quickstep. If it didn’t run successfully, then don’t worry, we’re always finding small issues. Like, on one of my linux test machines, I always have to delete lines related to &lt;code class=&quot;highlighter-rouge&quot;&gt;gflag&lt;/code&gt; in the &lt;code class=&quot;highlighter-rouge&quot;&gt;third_party/glog/CMakeLists.txt&lt;/code&gt; file because of a misconfiguration on that machine. However, on my mac, cmake runs fine.&lt;/p&gt;
&lt;p&gt;If you’re having trouble, one solution might be to install some dependencies. If you’re running Ubuntu, this might help:&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;sudo apt-get install -y build-essential protobuf-compiler libprotobuf-dev flex bison libnuma-dev&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;If that still doesn’t help, email the dev list. Seriously, we’re nice.&lt;/p&gt;
&lt;p&gt;Assuming you’ve generated the Makefiles, you can now build quickstep and all of the unit tests. This will run faster if we just build quickstep.&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# the -j option is how many workers to assign to the compilation&lt;/span&gt;
make -j4 quickstep_cli_shell&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Once quickstep builds, you should now be able to run your first query. You’ll need to tell quickstep where to store its files.&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;./quickstep_cli_shell --initialize_db&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; --storage_path&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;store&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;This will initialize a directory called &lt;code class=&quot;highlighter-rouge&quot;&gt;store&lt;/code&gt; where quickstep will persist data. If this ran successfully, then you should be seeing the command line prompt. For more information on what flags are available, enter &lt;code class=&quot;highlighter-rouge&quot;&gt;./quickstep_cli_shell --help&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we can run our first query! Let’s create a bunch of records and then aggregate over them.&lt;/p&gt;
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_numbers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;INT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INTO&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_numbers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1969&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1337&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;generate_series&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AVG&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_numbers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;GROUP&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;Of course, that query is meaningless but it should give you some idea of the sophistication of the SQL interface. This post is meant to give a taste of how I would get started with Quickstep. If it’s not enough or you want more information, we’ve been really good about updating our documentation. Checkout our &lt;a href=&quot;https://github.com/apache/incubator-quickstep/blob/master/README.md&quot;&gt;README&lt;/a&gt; and &lt;a href=&quot;https://github.com/apache/incubator-quickstep/blob/master/DEV_README.md&quot;&gt;DEV_GUIDE&lt;/a&gt; for more pointers!&lt;/p&gt;</content><author><name>Marc</name></author><summary type="html">For this tutorial, I’m going to assume you’re running in a unix environment. If you’re having trouble building on Windows, try asking the dev community (dev@quickstep.incubating.apache.org). You can also find a complete guide here in our documentation.</summary></entry></feed>