Author: jihoonson
Date: Wed Jul 22 09:16:21 2015
New Revision: 1692247
URL: http://svn.apache.org/r1692247
Log:
TAJO-1628: missing files
Added:
tajo/site/docs/devel/_sources/sql_language/alter_table.txt
tajo/site/docs/devel/_sources/sql_language/joins.txt
tajo/site/docs/devel/_sources/storage_plugin.txt
tajo/site/docs/devel/_sources/table_management/tablespaces.txt
tajo/site/docs/devel/sql_language/alter_table.html
tajo/site/docs/devel/sql_language/joins.html
tajo/site/docs/devel/storage_plugin.html
tajo/site/docs/devel/table_management/tablespaces.html
Added: tajo/site/docs/devel/_sources/sql_language/alter_table.txt
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/_sources/sql_language/alter_table.txt?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/_sources/sql_language/alter_table.txt (added)
+++ tajo/site/docs/devel/_sources/sql_language/alter_table.txt Wed Jul 22
09:16:21 2015
@@ -0,0 +1,100 @@
+************************
+ALTER TABLE
+************************
+
+========================
+RENAME TABLE
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> RENAME TO <new_table_name>
+
+ For example:
+ ALTER TABLE table1 RENAME TO table2;
+
+This statement lets you change the name of a table to a different name.
+
+========================
+RENAME COLUMN
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> RENAME COLUMN <column_name> TO <new_column_name>
+
+ For example:
+ ALTER TABLE table1 RENAME COLUMN id TO id2;
+
+This statement will allow users to change a column's name.
+
+========================
+ADD COLUMN
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> ADD COLUMN <column_name> <data_type>
+
+ For example:
+ ALTER TABLE table1 ADD COLUMN id text;
+
+This statement lets you add new columns to the end of the existing column.
+
+========================
+SET PROPERTY
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> SET PROPERTY (<key> = <value>, ...)
+
+ For example:
+ ALTER TABLE table1 SET PROPERTY 'timezone' = 'GMT-7'
+ ALTER TABLE table1 SET PROPERTY 'text.delimiter' = '&'
+ ALTER TABLE table1 SET PROPERTY
'compression.type'='RECORD','compression.codec'='org.apache.hadoop.io.compress.SnappyCodec'
+
+
+This statement will allow users to change a table property.
+
+========================
+ADD PARTITION
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> [IF NOT EXISTS] ADD PARTITION (<partition column> =
<partition value>, ...) [LOCATION = <partition's path>]
+
+ For example:
+ ALTER TABLE table1 ADD PARTITION (col1 = 1 , col2 = 2)
+ ALTER TABLE table1 ADD PARTITION (col1 = 1 , col2 = 2) LOCATION
'hdfs://xxx.com/warehouse/table1/col1=1/col2=2'
+
+You can use ``ALTER TABLE ADD PARTITION`` to add partitions to a table. The
location must be a directory inside of which data files reside. If the location
doesn't exist on the file system, Tajo will make the location by force. ``ADD
PARTITION`` changes the table metadata, but does not load data. If the data
does not exist in the partition's location, queries will not return any results.
+
+========================
+ DROP PARTITION
+========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+ ALTER TABLE <table_name> [IF NOT EXISTS] DROP PARTITION (<partition column>
= <partition value>, ...) [PURGE]
+
+ For example:
+ ALTER TABLE table1 DROP PARTITION (col1 = 1 , col2 = 2)
+ ALTER TABLE table1 DROP PARTITION (col1 = '2015' , col2 = '01', col3 = '11' )
+ ALTER TABLE table1 DROP PARTITION (col1 = 'TAJO' ) PURGE
+
+You can use ``ALTER TABLE DROP PARTITION`` to drop a partition for a table.
This removes the data for a managed table
+ and this doesn't remove the data for an external table. But if ``PURGE`` is
specified for an external table, the partition data will be removed. The
metadata is completely lost in all cases.
\ No newline at end of file
Added: tajo/site/docs/devel/_sources/sql_language/joins.txt
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/_sources/sql_language/joins.txt?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/_sources/sql_language/joins.txt (added)
+++ tajo/site/docs/devel/_sources/sql_language/joins.txt Wed Jul 22 09:16:21
2015
@@ -0,0 +1,160 @@
+**************************
+Joins
+**************************
+
+=====================
+Overview
+=====================
+
+In Tajo, a single query can accesses multiple rows of the same or different
relations at one time. This query is called *join*.
+Currently, Tajo supports cross, inner, and outer joins.
+
+A join query can involve multiple relations in the ``FROM`` clause according
to the following rule.
+
+.. code-block:: sql
+
+ FROM joined_table [, joined_table [, ...] ]
+
+, where ``joined_table`` is:
+
+.. code-block:: sql
+
+ table_reference join_type table_reference [ ON join_condition ]
+
+``join_type`` can be one of the followings.
+
+.. code-block:: sql
+
+ CROSS JOIN
+ [ NATURAL ] [ INNER ] JOIN
+ { LEFT | RIGHT | FULL } OUTER JOIN
+
+``join_condition`` can be specified in the ``WHERE`` clause as well as the
``ON`` clause.
+
+For more information, please refer to :doc:`/sql_language/predicates`.
+
+.. note::
+
+ Currently, Tajo cannot natively support non-equality conditions. It means
that inner joins with non-equality conditions will be executed with cross
joins. Outer joins with non-equality conditions cannot be executed yet.
+
+=====================
+Examples
+=====================
+
+* For inner and outer joins, only equality conditions are allowed as follows.
For inner joins, implicit join notation is allowed.
+
+.. code-block:: sql
+
+ SELECT a.* FROM a, b WHERE a.id = b.id
+
+ SELECT a.* FROM a JOIN b ON (a.id = b.id)
+
+ SELECT a.* FROM a LEFT OUTER JOIN b ON (a.id = b.id AND a.type = b.type)
+
+However, the following query will be executed with CROSS join, thereby taking
a very long time.
+
+.. code-block:: sql
+
+ SELECT a.* FROM a JOIN b ON (a.id <> b.id)
+
+In addition, the following query is not allowed.
+
+.. code-block:: sql
+
+ SELECT a.* FROM a LEFT OUTER JOIN b ON (a.id > b.id)
+
+* You can join more than 2 tables in a query with multiple join types.
+
+.. code-block:: sql
+
+ SELECT a.* FROM a, b, c WHERE a.id = b.id AND b.id2 = c.id2
+
+ SELECT a.* FROM a INNER JOIN b ON a.id = b.id FULL OUTER JOIN c ON b.id2 =
c.id2
+
+When a query involves three or more tables, there may be a lot of possible
join orders. Tajo automatically finds the best join order regardless of the
input order. For example, suppose that relation ``b`` is larger than relation
``a``, and in turn, the relation ``c`` is larger than relation ``b``. The query
+
+.. code-block:: sql
+
+ SELECT a.* FROM c INNER JOIN b ON b.id2 = c.id2 INNER JOIN a ON a.id = b.id
+
+is rewritten to
+
+.. code-block:: sql
+
+ SELECT a.* FROM a INNER JOIN b ON a.id = b.id INNER JOIN c ON b.id2 = c.id2
+
+because early join of small relations accelerates the query speed.
+
+* Tajo also supports natural join. When relations have a common column name,
they are joined with an equality condition on that column even though it is not
explicitly declared in the query. For example,
+
+.. code-block:: sql
+
+ SELECT a.* FROM a JOIN b
+
+is rewritten to
+
+.. code-block:: sql
+
+ SELECT a.* FROM a INNER JOIN b ON a.id = b.id
+
+=====================
+Join Optimization
+=====================
+
+Join is one of the most expensive operations in relational world.
+Tajo adopts several optimization techniques to improve its join performance.
+
+---------------------
+Join ordering
+---------------------
+
+Join ordering is one of the important techniques for join performance
improvement.
+Basically, joining multiple relations is left-associative. However, query
performance can be significantly changed according to which order is chosen for
the join execution.
+
+To find the best join order, Tajo's cost-based optimizer considers join
conditions, join types, and the size of input relations.
+In addition, it considers the computation cost of consecutive joins so that
the shape of query plan forms a bushy tree.
+
+For example, suppose that there are 4 relations ``a`` (10), ``b`` (20), ``c``
(30), and ``d``(40) where the numbers within brackets represent the relation
size.
+The following query
+
+.. code-block:: sql
+
+ SELECT
+ *
+ FROM
+ a, b, c, d
+ WHERE
+ a.id1 = b.id1 AND
+ a.id4 = d.id4 AND
+ b.id2 = c.id2 AND
+ c.id3 = d.id3
+
+is rewritten into
+
+.. code-block:: sql
+
+ SELECT
+ *
+ FROM
+ (a INNER JOIN d ON a.id4 = d.id4)
+ INNER JOIN
+ (b INNER JOIN c ON b.id2 = c.id2)
+ ON a.id1 = b.id1 AND c.id3 = d.id3
+
+
+---------------------
+Broadcast join
+---------------------
+
+In Tajo, a join query is executed in two stages. The first stage is
responsible for scanning input data and performing local join, while the second
stage is responsible for performing global join and returning the result.
+To perform join globally in the second stage, intermediate result of the first
stage is exchanged according to join keys, i.e., *shuffled*, among Tajo workers.
+Here, the cost of shuffle is expensive especially when the input relation size
is very small.
+
+Broadcast join is a good solution to handle this problem. In broadcast join,
the small relations are replicated to every worker who participates in the join
computation.
+Thus, they can perform join without expensive data shuffle.
+
+Tajo provides a session variable for broadcast join configuration. (For more
detailed information of session variables, please refer to
:doc:`/tsql/variables`.)
+
+* ``DIST_QUERY_BROADCAST_JOIN_THRESHOLD`` is a threshold for broadcast join.
Only the relations who are larger than this value can be broadcasted.
+
+You can also apply this configuration system widely by setting
``tajo.dist-query.join.broadcast.threshold-bytes`` in
``${TAJO_HOME}/conf/tajo-site.xml``.
\ No newline at end of file
Added: tajo/site/docs/devel/_sources/storage_plugin.txt
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/_sources/storage_plugin.txt?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/_sources/storage_plugin.txt (added)
+++ tajo/site/docs/devel/_sources/storage_plugin.txt Wed Jul 22 09:16:21 2015
@@ -0,0 +1,47 @@
+*************************************
+Storage Plugin
+*************************************
+
+Overview
+========
+
+Tajo supports various storage systems, such as HDFS, Amazon S3, Openstack
Swift, and HBase. Also, we have a plan to support RDBMS storages like Oracle,
MySQL, PostgreSQL. Tajo already embeds HDFS, S3, Openstack, and HBase, and also
Tajo allows users to register custom storages and data formats to Tajo cluster
instances. This section describes how you register custom storages and data
types.
+
+Register custom storage
+=======================
+
+First of all, your storage implementation should be packed as a jar file.
Then, please copy the jar file into ``tajo/extlib`` directory. Next, you should
copy ``conf/storage-site.json.template`` into ``conf/storage-site.json`` and
modify the file like the below.
+
+Configuration
+=============
+
+Tajo has a default configuration for builtin storages, such as HDFS, local
file system, and Amazon S3. it also allows users to add custom storage plugins
+
+``conf/storage-site.json`` file has the following struct:
+
+.. code-block:: json
+
+ {
+ "storages": {
+ "${scheme}": {
+ "handler": "${class name}"
+ }
+ }
+ }
+
+Each storage instance (i.e., :doc:`/table_management/tablespaces`) is
identified by an URI. The scheme of URI plays a role to identify storage type.
For example, ``hdfs://`` is used for Hdfs storage, ``jdbc://`` is used for
JDBC-based storage, and ``hbase://`` is used for HBase storage.
+
+You should substitute a scheme name without ``://`` for ``${scheme}``.
+
+See an example for HBase storage.
+
+.. code-block:: json
+
+ {
+ "storages": {
+ "hbase": {
+ "handler": "org.apache.tajo.storage.hbase.HBaseTablespace",
+ "default-format": "hbase"
+ }
+ }
+ }
\ No newline at end of file
Added: tajo/site/docs/devel/_sources/table_management/tablespaces.txt
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/_sources/table_management/tablespaces.txt?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/_sources/table_management/tablespaces.txt (added)
+++ tajo/site/docs/devel/_sources/table_management/tablespaces.txt Wed Jul 22
09:16:21 2015
@@ -0,0 +1,45 @@
+*************************************
+Tablespaces
+*************************************
+
+Tablespaces in Tajo allow users to define locations in the storage system
where the files or data objects representing database objects can be stored.
Once defined, a tablespace can be referred to by name when creating a database
or a table. Especially, it is very useful when a Tajo cluster instance should
use heterogeneous storage systems such as HDFS, MySQL, and Oracle.
+
+Configuration
+=============
+
+By default, Tajo use in ``${tajo.rootdir}/warehouse`` in
``conf/tajo-site.xml`` as a default tablespace. It also allows users to
register additional tablespaces.
+
+``conf/storage-site.json`` file.
+
+The configuration file has the following struct:
+
+.. code-block:: json
+
+ {
+ "spaces": {
+ "${table_space_name}": {
+ "uri": "hbase://quorum1:port,quorum2:port/"
+ }
+ }
+ }
+
+The following is an example for two tablespaces for hbase and hdfs:
+
+.. code-block:: json
+
+ {
+ "spaces": {
+ "hbase-cluster1": {
+ "uri": "hbase://quorum1:port,quorum2:port/"
+ },
+
+ "ssd": {
+ "uri": "hdfs://host:port/data/ssd"
+ }
+ }
+ }
+
+
+.. note::
+
+ Also, each tablespace can use different storage type. Please see
:doc:`/storage_plugin` if you want to know more information about it.
\ No newline at end of file
Added: tajo/site/docs/devel/sql_language/alter_table.html
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/sql_language/alter_table.html?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/sql_language/alter_table.html (added)
+++ tajo/site/docs/devel/sql_language/alter_table.html Wed Jul 22 09:16:21 2015
@@ -0,0 +1,350 @@
+
+
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <title>ALTER TABLE — Apache Tajo 0.11.0 documentation</title>
+
+
+
+
+
+
+ <link
href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700'
rel='stylesheet' type='text/css'>
+
+
+
+
+
+
+
+
+
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
+
+
+
+ <link rel="top" title="Apache Tajo 0.11.0 documentation"
href="../index.html"/>
+ <link rel="up" title="SQL Language" href="../sql_language.html"/>
+ <link rel="next" title="Queries" href="queries.html"/>
+ <link rel="prev" title="INSERT (OVERWRITE) INTO" href="insert.html"/>
+
+
+ <script
src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
+
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+ <div class="wy-grid-for-nav">
+
+
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
+ <div class="wy-side-nav-search">
+ <a href="../index.html" class="fa fa-home"> Apache Tajo</a>
+ <div role="search">
+ <form id ="rtd-search-form" class="wy-form" action="../search.html"
method="get">
+ <input type="text" name="q" placeholder="Search docs" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+</div>
+ </div>
+
+ <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation"
aria-label="main navigation">
+
+
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal"
href="../introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../getting_started.html">Getting Started</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#prerequisites">Prerequisites</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#dowload-and-unpack-the-source-code">Dowload and
unpack the source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#build-source-code">Build source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#setting-up-a-local-tajo-cluster">Setting up a
local Tajo cluster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#first-query-execution">First query
execution</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../configuration.html">Configuration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/preliminary.html">Preliminary</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/cluster_setup.html">Cluster Setup</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/tajo_master_configuration.html">Tajo Master
Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/worker_configuration.html">Worker Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/catalog_configuration.html">Catalog
Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/ha_configuration.html">High Availability for
TajoMaster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/service_config_defaults.html">Cluster Service
Configuration Defaults</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/tajo-site-xml.html">The tajo-site.xml File</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/catalog-site-xml.html">The catalog-site.xml File</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="../tsql.html">Tajo
Shell (TSQL)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/meta_command.html">Meta Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/dfs_command.html">Executing HDFS commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/variables.html">Session Variables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/admin_command.html">Administration Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/intro.html">Introducing to TSQL</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/single_command.html">Executing a single command</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/execute_file.html">Executing Queries from Files</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/background_command.html">Executing as background process</a></li>
+</ul>
+</li>
+<li class="toctree-l1 current"><a class="reference internal"
href="../sql_language.html">SQL Language</a><ul class="current">
+<li class="toctree-l2"><a class="reference internal"
href="data_model.html">Data Model</a></li>
+<li class="toctree-l2"><a class="reference internal" href="ddl.html">Data
Definition Language</a></li>
+<li class="toctree-l2"><a class="reference internal" href="insert.html">INSERT
(OVERWRITE) INTO</a></li>
+<li class="toctree-l2 current"><a class="current reference internal"
href="">ALTER TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="queries.html">Queries</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="joins.html">Joins</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_expression.html">SQL Expressions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="predicates.html">Predicates</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../time_zone.html">Time Zone</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#server-cluster-time-zone">Server Cluster Time
Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#table-time-zone">Table Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#client-time-zone">Client Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#time-zone-id">Time Zone ID</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#examples-of-time-zone">Examples of Time Zone</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../functions.html">Functions</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../functions.html#built-in-functions">Built-in Functions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../functions.html#user-defined-functions">User-defined Functions</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../table_management.html">Table Management</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/table_overview.html">Overview of Tajo Tables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/tablespaces.html">Tablespaces</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/file_formats.html">File Formats</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/compression.html">Compression</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../table_partitioning.html">Table Partitioning</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/intro_to_partitioning.html">Introduction to
Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/column_partitioning.html">Column Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/range_partitioning.html">Range Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/hash_partitioning.html">Hash Partitioning</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../storage_plugin.html">Storage Plugin</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#overview">Overview</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#register-custom-storage">Register custom
storage</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#configuration">Configuration</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../index_overview.html">Index (Experimental Feature)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../index/types.html">Index Types</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../index/how_to_use.html">How to use index?</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../index/future_work.html">Future Works</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../backup_and_restore.html">Backup and Restore</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../backup_and_restore/catalog.html">Backup and Restore Catalog</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../hive_integration.html">Hive Integration</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../hbase_integration.html">HBase Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#create-table">CREATE TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#drop-table">DROP TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#insert-overwrite-into">INSERT (OVERWRITE)
INTO</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#usage">Usage</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../swift_integration.html">OpenStack Swift Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#swift-configuration">Swift
configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#hadoop-configurations">Hadoop
configurations</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#tajo-configuration">Tajo configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#querying-on-swift">Querying on Swift</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../jdbc_driver.html">Tajo JDBC Driver</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#how-to-get-jdbc-driver">How to get JDBC
driver</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#setting-the-classpath">Setting the CLASSPATH</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#an-example-jdbc-client">An Example JDBC
Client</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../tajo_client_api.html">Tajo Client API</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../faq.html">FAQ</a></li>
+</ul>
+
+
+ </div>
+
+ </nav>
+
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+
+ <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">Apache Tajo</a>
+ </nav>
+
+
+
+ <div class="wy-nav-content">
+ <div class="rst-content">
+ <div role="navigation" aria-label="breadcrumbs navigation">
+ <ul class="wy-breadcrumbs">
+ <li><a href="../index.html">Docs</a> »</li>
+
+ <li><a href="../sql_language.html">SQL Language</a> »</li>
+
+ <li>ALTER TABLE</li>
+ <li class="wy-breadcrumbs-aside">
+
+ <a href="../_sources/sql_language/alter_table.txt" rel="nofollow">
View page source</a>
+
+ </li>
+ </ul>
+ <hr/>
+</div>
+ <div role="main">
+
+ <div class="section" id="alter-table">
+<h1>ALTER TABLE<a class="headerlink" href="#alter-table" title="Permalink to
this headline">¶</a></h1>
+<div class="section" id="rename-table">
+<h2>RENAME TABLE<a class="headerlink" href="#rename-table" title="Permalink to
this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">ALTER</span> <span class="k">TABLE</span> <span
class="o"><</span><span class="k">table_name</span><span
class="o">></span> <span class="k">RENAME</span> <span class="k">TO</span>
<span class="o"><</span><span class="n">new_table_name</span><span
class="o">></span>
+
+<span class="k">For</span> <span class="n">example</span><span
class="p">:</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">RENAME</span> <span class="k">TO</span>
<span class="n">table2</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This statement lets you change the name of a table to a different name.</p>
+</div>
+<div class="section" id="rename-column">
+<h2>RENAME COLUMN<a class="headerlink" href="#rename-column" title="Permalink
to this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">ALTER</span> <span class="k">TABLE</span> <span
class="o"><</span><span class="k">table_name</span><span
class="o">></span> <span class="k">RENAME</span> <span
class="k">COLUMN</span> <span class="o"><</span><span
class="k">column_name</span><span class="o">></span> <span
class="k">TO</span> <span class="o"><</span><span
class="n">new_column_name</span><span class="o">></span>
+
+<span class="k">For</span> <span class="n">example</span><span
class="p">:</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">RENAME</span> <span
class="k">COLUMN</span> <span class="n">id</span> <span class="k">TO</span>
<span class="n">id2</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This statement will allow users to change a column’s name.</p>
+</div>
+<div class="section" id="add-column">
+<h2>ADD COLUMN<a class="headerlink" href="#add-column" title="Permalink to
this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">ALTER</span> <span class="k">TABLE</span> <span
class="o"><</span><span class="k">table_name</span><span
class="o">></span> <span class="k">ADD</span> <span class="k">COLUMN</span>
<span class="o"><</span><span class="k">column_name</span><span
class="o">></span> <span class="o"><</span><span
class="n">data_type</span><span class="o">></span>
+
+<span class="k">For</span> <span class="n">example</span><span
class="p">:</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">ADD</span> <span
class="k">COLUMN</span> <span class="n">id</span> <span
class="nb">text</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This statement lets you add new columns to the end of the existing
column.</p>
+</div>
+<div class="section" id="set-property">
+<h2>SET PROPERTY<a class="headerlink" href="#set-property" title="Permalink to
this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">ALTER</span> <span class="k">TABLE</span> <span
class="o"><</span><span class="k">table_name</span><span
class="o">></span> <span class="k">SET</span> <span
class="n">PROPERTY</span> <span class="p">(</span><span
class="o"><</span><span class="k">key</span><span class="o">></span>
<span class="o">=</span> <span class="o"><</span><span
class="n">value</span><span class="o">></span><span class="p">,</span> <span
class="p">...)</span>
+
+<span class="k">For</span> <span class="n">example</span><span
class="p">:</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">SET</span> <span
class="n">PROPERTY</span> <span class="s1">'timezone'</span> <span
class="o">=</span> <span class="s1">'GMT-7'</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">SET</span> <span
class="n">PROPERTY</span> <span class="s1">'text.delimiter'</span>
<span class="o">=</span> <span class="s1">'&'</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">SET</span> <span
class="n">PROPERTY</span> <span
class="s1">'compression.type'</span><span class="o">=</span><span
class="s1">'RECORD'</span><span class="p">,</span><span
class="s1">'compression.codec'</span><span class="o">=</span><span
class="s1">'org.apache.hadoop.io.compress.SnappyCodec'</span>
+</pre></div>
+</div>
+<p>This statement will allow users to change a table property.</p>
+</div>
+<div class="section" id="add-partition">
+<h2>ADD PARTITION<a class="headerlink" href="#add-partition" title="Permalink
to this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre>ALTER TABLE
<table_name> [IF NOT EXISTS] ADD PARTITION (<partition column> =
<partition value>, ...) [LOCATION = <partition's path>]
+
+For example:
+ALTER TABLE table1 ADD PARTITION (col1 = 1 , col2 = 2)
+ALTER TABLE table1 ADD PARTITION (col1 = 1 , col2 = 2) LOCATION
'hdfs://xxx.com/warehouse/table1/col1=1/col2=2'
+</pre></div>
+</div>
+<p>You can use <code class="docutils literal"><span class="pre">ALTER</span>
<span class="pre">TABLE</span> <span class="pre">ADD</span> <span
class="pre">PARTITION</span></code> to add partitions to a table. The location
must be a directory inside of which data files reside. If the location
doesn’t exist on the file system, Tajo will make the location by force.
<code class="docutils literal"><span class="pre">ADD</span> <span
class="pre">PARTITION</span></code> changes the table metadata, but does not
load data. If the data does not exist in the partition’s location,
queries will not return any results.</p>
+</div>
+<div class="section" id="drop-partition">
+<h2>DROP PARTITION<a class="headerlink" href="#drop-partition"
title="Permalink to this headline">¶</a></h2>
+<p><em>Synopsis</em></p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">ALTER</span> <span class="k">TABLE</span> <span
class="o"><</span><span class="k">table_name</span><span
class="o">></span> <span class="p">[</span><span class="n">IF</span> <span
class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span>
<span class="k">DROP</span> <span class="n">PARTITION</span> <span
class="p">(</span><span class="o"><</span><span class="n">partition</span>
<span class="k">column</span><span class="o">></span> <span
class="o">=</span> <span class="o"><</span><span class="n">partition</span>
<span class="n">value</span><span class="o">></span><span class="p">,</span>
<span class="p">...)</span> <span class="p">[</span><span
class="n">PURGE</span><span class="p">]</span>
+
+<span class="k">For</span> <span class="n">example</span><span
class="p">:</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">DROP</span> <span
class="n">PARTITION</span> <span class="p">(</span><span class="n">col1</span>
<span class="o">=</span> <span class="mi">1</span> <span class="p">,</span>
<span class="n">col2</span> <span class="o">=</span> <span
class="mi">2</span><span class="p">)</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">DROP</span> <span
class="n">PARTITION</span> <span class="p">(</span><span class="n">col1</span>
<span class="o">=</span> <span class="s1">'2015'</span> <span
class="p">,</span> <span class="n">col2</span> <span class="o">=</span> <span
class="s1">'01'</span><span class="p">,</span> <span
class="n">col3</span> <span class="o">=</span> <span
class="s1">'11'</span> <span class="p">)</span>
+<span class="k">ALTER</span> <span class="k">TABLE</span> <span
class="n">table1</span> <span class="k">DROP</span> <span
class="n">PARTITION</span> <span class="p">(</span><span class="n">col1</span>
<span class="o">=</span> <span class="s1">'TAJO'</span> <span
class="p">)</span> <span class="n">PURGE</span>
+</pre></div>
+</div>
+<dl class="docutils">
+<dt>You can use <code class="docutils literal"><span class="pre">ALTER</span>
<span class="pre">TABLE</span> <span class="pre">DROP</span> <span
class="pre">PARTITION</span></code> to drop a partition for a table. This
removes the data for a managed table</dt>
+<dd>and this doesn’t remove the data for an external table. But if <code
class="docutils literal"><span class="pre">PURGE</span></code> is specified for
an external table, the partition data will be removed. The metadata is
completely lost in all cases.</dd>
+</dl>
+</div>
+</div>
+
+
+ </div>
+ <footer>
+
+ <div class="rst-footer-buttons" role="navigation" aria-label="footer
navigation">
+
+ <a href="queries.html" class="btn btn-neutral float-right"
title="Queries"/>Next <span class="fa fa-arrow-circle-right"></span></a>
+
+
+ <a href="insert.html" class="btn btn-neutral" title="INSERT
(OVERWRITE) INTO"><span class="fa fa-arrow-circle-left"></span> Previous</a>
+
+ </div>
+
+
+ <hr/>
+
+ <div role="contentinfo">
+ <p>
+ © Copyright 2014, Apache Tajo Team.
+ </p>
+ </div>
+
+ <a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>
+</footer>
+ </div>
+ </div>
+
+ </section>
+
+ </div>
+
+
+
+
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT:'../',
+ VERSION:'0.11.0',
+ 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/theme.js"></script>
+
+
+
+
+ <script type="text/javascript">
+ jQuery(function () {
+ SphinxRtdTheme.StickyNav.enable();
+ });
+ </script>
+
+
+</body>
+</html>
\ No newline at end of file
Added: tajo/site/docs/devel/sql_language/joins.html
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/sql_language/joins.html?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/sql_language/joins.html (added)
+++ tajo/site/docs/devel/sql_language/joins.html Wed Jul 22 09:16:21 2015
@@ -0,0 +1,397 @@
+
+
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <title>Joins — Apache Tajo 0.11.0 documentation</title>
+
+
+
+
+
+
+ <link
href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700'
rel='stylesheet' type='text/css'>
+
+
+
+
+
+
+
+
+
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
+
+
+
+ <link rel="top" title="Apache Tajo 0.11.0 documentation"
href="../index.html"/>
+ <link rel="up" title="SQL Language" href="../sql_language.html"/>
+ <link rel="next" title="SQL Expressions" href="sql_expression.html"/>
+ <link rel="prev" title="Queries" href="queries.html"/>
+
+
+ <script
src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
+
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+ <div class="wy-grid-for-nav">
+
+
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
+ <div class="wy-side-nav-search">
+ <a href="../index.html" class="fa fa-home"> Apache Tajo</a>
+ <div role="search">
+ <form id ="rtd-search-form" class="wy-form" action="../search.html"
method="get">
+ <input type="text" name="q" placeholder="Search docs" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+</div>
+ </div>
+
+ <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation"
aria-label="main navigation">
+
+
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal"
href="../introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../getting_started.html">Getting Started</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#prerequisites">Prerequisites</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#dowload-and-unpack-the-source-code">Dowload and
unpack the source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#build-source-code">Build source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#setting-up-a-local-tajo-cluster">Setting up a
local Tajo cluster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../getting_started.html#first-query-execution">First query
execution</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../configuration.html">Configuration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/preliminary.html">Preliminary</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/cluster_setup.html">Cluster Setup</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/tajo_master_configuration.html">Tajo Master
Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/worker_configuration.html">Worker Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/catalog_configuration.html">Catalog
Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/ha_configuration.html">High Availability for
TajoMaster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/service_config_defaults.html">Cluster Service
Configuration Defaults</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/tajo-site-xml.html">The tajo-site.xml File</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../configuration/catalog-site-xml.html">The catalog-site.xml File</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="../tsql.html">Tajo
Shell (TSQL)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/meta_command.html">Meta Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/dfs_command.html">Executing HDFS commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/variables.html">Session Variables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/admin_command.html">Administration Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/intro.html">Introducing to TSQL</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/single_command.html">Executing a single command</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/execute_file.html">Executing Queries from Files</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../tsql/background_command.html">Executing as background process</a></li>
+</ul>
+</li>
+<li class="toctree-l1 current"><a class="reference internal"
href="../sql_language.html">SQL Language</a><ul class="current">
+<li class="toctree-l2"><a class="reference internal"
href="data_model.html">Data Model</a></li>
+<li class="toctree-l2"><a class="reference internal" href="ddl.html">Data
Definition Language</a></li>
+<li class="toctree-l2"><a class="reference internal" href="insert.html">INSERT
(OVERWRITE) INTO</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="alter_table.html">ALTER TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="queries.html">Queries</a></li>
+<li class="toctree-l2 current"><a class="current reference internal"
href="">Joins</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_expression.html">SQL Expressions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="predicates.html">Predicates</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../time_zone.html">Time Zone</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#server-cluster-time-zone">Server Cluster Time
Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#table-time-zone">Table Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#client-time-zone">Client Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#time-zone-id">Time Zone ID</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../time_zone.html#examples-of-time-zone">Examples of Time Zone</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../functions.html">Functions</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../functions.html#built-in-functions">Built-in Functions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../functions.html#user-defined-functions">User-defined Functions</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../table_management.html">Table Management</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/table_overview.html">Overview of Tajo Tables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/tablespaces.html">Tablespaces</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/file_formats.html">File Formats</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../table_management/compression.html">Compression</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../table_partitioning.html">Table Partitioning</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/intro_to_partitioning.html">Introduction to
Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/column_partitioning.html">Column Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/range_partitioning.html">Range Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../partitioning/hash_partitioning.html">Hash Partitioning</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../storage_plugin.html">Storage Plugin</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#overview">Overview</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#register-custom-storage">Register custom
storage</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../storage_plugin.html#configuration">Configuration</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../index_overview.html">Index (Experimental Feature)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../index/types.html">Index Types</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../index/how_to_use.html">How to use index?</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../index/future_work.html">Future Works</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../backup_and_restore.html">Backup and Restore</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../backup_and_restore/catalog.html">Backup and Restore Catalog</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../hive_integration.html">Hive Integration</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../hbase_integration.html">HBase Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#create-table">CREATE TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#drop-table">DROP TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#insert-overwrite-into">INSERT (OVERWRITE)
INTO</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../hbase_integration.html#usage">Usage</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../swift_integration.html">OpenStack Swift Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#swift-configuration">Swift
configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#hadoop-configurations">Hadoop
configurations</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#tajo-configuration">Tajo configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../swift_integration.html#querying-on-swift">Querying on Swift</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../jdbc_driver.html">Tajo JDBC Driver</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#how-to-get-jdbc-driver">How to get JDBC
driver</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#setting-the-classpath">Setting the CLASSPATH</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="../jdbc_driver.html#an-example-jdbc-client">An Example JDBC
Client</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="../tajo_client_api.html">Tajo Client API</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="../faq.html">FAQ</a></li>
+</ul>
+
+
+ </div>
+
+ </nav>
+
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+
+ <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">Apache Tajo</a>
+ </nav>
+
+
+
+ <div class="wy-nav-content">
+ <div class="rst-content">
+ <div role="navigation" aria-label="breadcrumbs navigation">
+ <ul class="wy-breadcrumbs">
+ <li><a href="../index.html">Docs</a> »</li>
+
+ <li><a href="../sql_language.html">SQL Language</a> »</li>
+
+ <li>Joins</li>
+ <li class="wy-breadcrumbs-aside">
+
+ <a href="../_sources/sql_language/joins.txt" rel="nofollow"> View
page source</a>
+
+ </li>
+ </ul>
+ <hr/>
+</div>
+ <div role="main">
+
+ <div class="section" id="joins">
+<h1>Joins<a class="headerlink" href="#joins" title="Permalink to this
headline">¶</a></h1>
+<div class="section" id="overview">
+<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this
headline">¶</a></h2>
+<p>In Tajo, a single query can accesses multiple rows of the same or different
relations at one time. This query is called <em>join</em>.
+Currently, Tajo supports cross, inner, and outer joins.</p>
+<p>A join query can involve multiple relations in the <code class="docutils
literal"><span class="pre">FROM</span></code> clause according to the following
rule.</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">FROM</span> <span class="n">joined_table</span> <span
class="p">[,</span> <span class="n">joined_table</span> <span
class="p">[,</span> <span class="p">...]</span> <span class="p">]</span>
+</pre></div>
+</div>
+<p>, where <code class="docutils literal"><span
class="pre">joined_table</span></code> is:</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="n">table_reference</span> <span class="n">join_type</span> <span
class="n">table_reference</span> <span class="p">[</span> <span
class="k">ON</span> <span class="n">join_condition</span> <span
class="p">]</span>
+</pre></div>
+</div>
+<p><code class="docutils literal"><span class="pre">join_type</span></code>
can be one of the followings.</p>
+<div class="highlight-sql"><div class="highlight"><pre>CROSS JOIN
+[ NATURAL ] [ INNER ] JOIN
+{ LEFT | RIGHT | FULL } OUTER JOIN
+</pre></div>
+</div>
+<p><code class="docutils literal"><span
class="pre">join_condition</span></code> can be specified in the <code
class="docutils literal"><span class="pre">WHERE</span></code> clause as well
as the <code class="docutils literal"><span class="pre">ON</span></code>
clause.</p>
+<p>For more information, please refer to <a class="reference internal"
href="predicates.html"><em>Predicates</em></a>.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Currently, Tajo cannot natively support non-equality
conditions. It means that inner joins with non-equality conditions will be
executed with cross joins. Outer joins with non-equality conditions cannot be
executed yet.</p>
+</div>
+</div>
+<div class="section" id="examples">
+<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this
headline">¶</a></h2>
+<ul class="simple">
+<li>For inner and outer joins, only equality conditions are allowed as
follows. For inner joins, implicit join notation is allowed.</li>
+</ul>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span><span
class="p">,</span> <span class="n">b</span> <span class="k">WHERE</span> <span
class="n">a</span><span class="p">.</span><span class="n">id</span> <span
class="o">=</span> <span class="n">b</span><span class="p">.</span><span
class="n">id</span>
+
+<span class="k">SELECT</span> <span class="n">a</span><span
class="p">.</span><span class="o">*</span> <span class="k">FROM</span> <span
class="n">a</span> <span class="k">JOIN</span> <span class="n">b</span> <span
class="k">ON</span> <span class="p">(</span><span class="n">a</span><span
class="p">.</span><span class="n">id</span> <span class="o">=</span> <span
class="n">b</span><span class="p">.</span><span class="n">id</span><span
class="p">)</span>
+
+<span class="k">SELECT</span> <span class="n">a</span><span
class="p">.</span><span class="o">*</span> <span class="k">FROM</span> <span
class="n">a</span> <span class="k">LEFT</span> <span class="k">OUTER</span>
<span class="k">JOIN</span> <span class="n">b</span> <span class="k">ON</span>
<span class="p">(</span><span class="n">a</span><span class="p">.</span><span
class="n">id</span> <span class="o">=</span> <span class="n">b</span><span
class="p">.</span><span class="n">id</span> <span class="k">AND</span> <span
class="n">a</span><span class="p">.</span><span class="k">type</span> <span
class="o">=</span> <span class="n">b</span><span class="p">.</span><span
class="k">type</span><span class="p">)</span>
+</pre></div>
+</div>
+<p>However, the following query will be executed with CROSS join, thereby
taking a very long time.</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span> <span
class="k">JOIN</span> <span class="n">b</span> <span class="k">ON</span> <span
class="p">(</span><span class="n">a</span><span class="p">.</span><span
class="n">id</span> <span class="o"><></span> <span
class="n">b</span><span class="p">.</span><span class="n">id</span><span
class="p">)</span>
+</pre></div>
+</div>
+<p>In addition, the following query is not allowed.</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span> <span
class="k">LEFT</span> <span class="k">OUTER</span> <span class="k">JOIN</span>
<span class="n">b</span> <span class="k">ON</span> <span
class="p">(</span><span class="n">a</span><span class="p">.</span><span
class="n">id</span> <span class="o">></span> <span class="n">b</span><span
class="p">.</span><span class="n">id</span><span class="p">)</span>
+</pre></div>
+</div>
+<ul class="simple">
+<li>You can join more than 2 tables in a query with multiple join types.</li>
+</ul>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span><span
class="p">,</span> <span class="n">b</span><span class="p">,</span> <span
class="k">c</span> <span class="k">WHERE</span> <span class="n">a</span><span
class="p">.</span><span class="n">id</span> <span class="o">=</span> <span
class="n">b</span><span class="p">.</span><span class="n">id</span> <span
class="k">AND</span> <span class="n">b</span><span class="p">.</span><span
class="n">id2</span> <span class="o">=</span> <span class="k">c</span><span
class="p">.</span><span class="n">id2</span>
+
+<span class="k">SELECT</span> <span class="n">a</span><span
class="p">.</span><span class="o">*</span> <span class="k">FROM</span> <span
class="n">a</span> <span class="k">INNER</span> <span class="k">JOIN</span>
<span class="n">b</span> <span class="k">ON</span> <span
class="n">a</span><span class="p">.</span><span class="n">id</span> <span
class="o">=</span> <span class="n">b</span><span class="p">.</span><span
class="n">id</span> <span class="k">FULL</span> <span class="k">OUTER</span>
<span class="k">JOIN</span> <span class="k">c</span> <span class="k">ON</span>
<span class="n">b</span><span class="p">.</span><span class="n">id2</span>
<span class="o">=</span> <span class="k">c</span><span class="p">.</span><span
class="n">id2</span>
+</pre></div>
+</div>
+<p>When a query involves three or more tables, there may be a lot of possible
join orders. Tajo automatically finds the best join order regardless of the
input order. For example, suppose that relation <code class="docutils
literal"><span class="pre">b</span></code> is larger than relation <code
class="docutils literal"><span class="pre">a</span></code>, and in turn, the
relation <code class="docutils literal"><span class="pre">c</span></code> is
larger than relation <code class="docutils literal"><span
class="pre">b</span></code>. The query</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="k">c</span> <span
class="k">INNER</span> <span class="k">JOIN</span> <span class="n">b</span>
<span class="k">ON</span> <span class="n">b</span><span class="p">.</span><span
class="n">id2</span> <span class="o">=</span> <span class="k">c</span><span
class="p">.</span><span class="n">id2</span> <span class="k">INNER</span> <span
class="k">JOIN</span> <span class="n">a</span> <span class="k">ON</span> <span
class="n">a</span><span class="p">.</span><span class="n">id</span> <span
class="o">=</span> <span class="n">b</span><span class="p">.</span><span
class="n">id</span>
+</pre></div>
+</div>
+<p>is rewritten to</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span> <span
class="k">INNER</span> <span class="k">JOIN</span> <span class="n">b</span>
<span class="k">ON</span> <span class="n">a</span><span class="p">.</span><span
class="n">id</span> <span class="o">=</span> <span class="n">b</span><span
class="p">.</span><span class="n">id</span> <span class="k">INNER</span> <span
class="k">JOIN</span> <span class="k">c</span> <span class="k">ON</span> <span
class="n">b</span><span class="p">.</span><span class="n">id2</span> <span
class="o">=</span> <span class="k">c</span><span class="p">.</span><span
class="n">id2</span>
+</pre></div>
+</div>
+<p>because early join of small relations accelerates the query speed.</p>
+<ul class="simple">
+<li>Tajo also supports natural join. When relations have a common column name,
they are joined with an equality condition on that column even though it is not
explicitly declared in the query. For example,</li>
+</ul>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span> <span
class="k">JOIN</span> <span class="n">b</span>
+</pre></div>
+</div>
+<p>is rewritten to</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span> <span class="n">a</span><span class="p">.</span><span
class="o">*</span> <span class="k">FROM</span> <span class="n">a</span> <span
class="k">INNER</span> <span class="k">JOIN</span> <span class="n">b</span>
<span class="k">ON</span> <span class="n">a</span><span class="p">.</span><span
class="n">id</span> <span class="o">=</span> <span class="n">b</span><span
class="p">.</span><span class="n">id</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="join-optimization">
+<h2>Join Optimization<a class="headerlink" href="#join-optimization"
title="Permalink to this headline">¶</a></h2>
+<p>Join is one of the most expensive operations in relational world.
+Tajo adopts several optimization techniques to improve its join
performance.</p>
+<div class="section" id="join-ordering">
+<h3>Join ordering<a class="headerlink" href="#join-ordering" title="Permalink
to this headline">¶</a></h3>
+<p>Join ordering is one of the important techniques for join performance
improvement.
+Basically, joining multiple relations is left-associative. However, query
performance can be significantly changed according to which order is chosen for
the join execution.</p>
+<p>To find the best join order, Tajo’s cost-based optimizer considers
join conditions, join types, and the size of input relations.
+In addition, it considers the computation cost of consecutive joins so that
the shape of query plan forms a bushy tree.</p>
+<p>For example, suppose that there are 4 relations <code class="docutils
literal"><span class="pre">a</span></code> (10), <code class="docutils
literal"><span class="pre">b</span></code> (20), <code class="docutils
literal"><span class="pre">c</span></code> (30), and <a href="#id1"><span
class="problematic" id="id2">``</span></a>d``(40) where the numbers within
brackets represent the relation size.
+The following query</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span>
+ <span class="o">*</span>
+<span class="k">FROM</span>
+ <span class="n">a</span><span class="p">,</span> <span
class="n">b</span><span class="p">,</span> <span class="k">c</span><span
class="p">,</span> <span class="n">d</span>
+<span class="k">WHERE</span>
+ <span class="n">a</span><span class="p">.</span><span class="n">id1</span>
<span class="o">=</span> <span class="n">b</span><span class="p">.</span><span
class="n">id1</span> <span class="k">AND</span>
+ <span class="n">a</span><span class="p">.</span><span class="n">id4</span>
<span class="o">=</span> <span class="n">d</span><span class="p">.</span><span
class="n">id4</span> <span class="k">AND</span>
+ <span class="n">b</span><span class="p">.</span><span class="n">id2</span>
<span class="o">=</span> <span class="k">c</span><span class="p">.</span><span
class="n">id2</span> <span class="k">AND</span>
+ <span class="k">c</span><span class="p">.</span><span class="n">id3</span>
<span class="o">=</span> <span class="n">d</span><span class="p">.</span><span
class="n">id3</span>
+</pre></div>
+</div>
+<p>is rewritten into</p>
+<div class="highlight-sql"><div class="highlight"><pre><span
class="k">SELECT</span>
+ <span class="o">*</span>
+<span class="k">FROM</span>
+ <span class="p">(</span><span class="n">a</span> <span
class="k">INNER</span> <span class="k">JOIN</span> <span class="n">d</span>
<span class="k">ON</span> <span class="n">a</span><span class="p">.</span><span
class="n">id4</span> <span class="o">=</span> <span class="n">d</span><span
class="p">.</span><span class="n">id4</span><span class="p">)</span>
+ <span class="k">INNER</span> <span class="k">JOIN</span>
+ <span class="p">(</span><span class="n">b</span> <span
class="k">INNER</span> <span class="k">JOIN</span> <span class="k">c</span>
<span class="k">ON</span> <span class="n">b</span><span class="p">.</span><span
class="n">id2</span> <span class="o">=</span> <span class="k">c</span><span
class="p">.</span><span class="n">id2</span><span class="p">)</span>
+ <span class="k">ON</span> <span class="n">a</span><span
class="p">.</span><span class="n">id1</span> <span class="o">=</span> <span
class="n">b</span><span class="p">.</span><span class="n">id1</span> <span
class="k">AND</span> <span class="k">c</span><span class="p">.</span><span
class="n">id3</span> <span class="o">=</span> <span class="n">d</span><span
class="p">.</span><span class="n">id3</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="broadcast-join">
+<h3>Broadcast join<a class="headerlink" href="#broadcast-join"
title="Permalink to this headline">¶</a></h3>
+<p>In Tajo, a join query is executed in two stages. The first stage is
responsible for scanning input data and performing local join, while the second
stage is responsible for performing global join and returning the result.
+To perform join globally in the second stage, intermediate result of the first
stage is exchanged according to join keys, i.e., <em>shuffled</em>, among Tajo
workers.
+Here, the cost of shuffle is expensive especially when the input relation size
is very small.</p>
+<p>Broadcast join is a good solution to handle this problem. In broadcast
join, the small relations are replicated to every worker who participates in
the join computation.
+Thus, they can perform join without expensive data shuffle.</p>
+<p>Tajo provides a session variable for broadcast join configuration. (For
more detailed information of session variables, please refer to <a
class="reference internal" href="../tsql/variables.html"><em>Session
Variables</em></a>.)</p>
+<ul class="simple">
+<li><code class="docutils literal"><span
class="pre">DIST_QUERY_BROADCAST_JOIN_THRESHOLD</span></code> is a threshold
for broadcast join. Only the relations who are larger than this value can be
broadcasted.</li>
+</ul>
+<p>You can also apply this configuration system widely by setting <code
class="docutils literal"><span
class="pre">tajo.dist-query.join.broadcast.threshold-bytes</span></code> in
<code class="docutils literal"><span
class="pre">${TAJO_HOME}/conf/tajo-site.xml</span></code>.</p>
+</div>
+</div>
+</div>
+
+
+ </div>
+ <footer>
+
+ <div class="rst-footer-buttons" role="navigation" aria-label="footer
navigation">
+
+ <a href="sql_expression.html" class="btn btn-neutral float-right"
title="SQL Expressions"/>Next <span class="fa fa-arrow-circle-right"></span></a>
+
+
+ <a href="queries.html" class="btn btn-neutral" title="Queries"><span
class="fa fa-arrow-circle-left"></span> Previous</a>
+
+ </div>
+
+
+ <hr/>
+
+ <div role="contentinfo">
+ <p>
+ © Copyright 2014, Apache Tajo Team.
+ </p>
+ </div>
+
+ <a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>
+</footer>
+ </div>
+ </div>
+
+ </section>
+
+ </div>
+
+
+
+
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT:'../',
+ VERSION:'0.11.0',
+ 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/theme.js"></script>
+
+
+
+
+ <script type="text/javascript">
+ jQuery(function () {
+ SphinxRtdTheme.StickyNav.enable();
+ });
+ </script>
+
+
+</body>
+</html>
\ No newline at end of file
Added: tajo/site/docs/devel/storage_plugin.html
URL:
http://svn.apache.org/viewvc/tajo/site/docs/devel/storage_plugin.html?rev=1692247&view=auto
==============================================================================
--- tajo/site/docs/devel/storage_plugin.html (added)
+++ tajo/site/docs/devel/storage_plugin.html Wed Jul 22 09:16:21 2015
@@ -0,0 +1,308 @@
+
+
+<!DOCTYPE html>
+<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <title>Storage Plugin — Apache Tajo 0.11.0 documentation</title>
+
+
+
+
+
+
+ <link
href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700'
rel='stylesheet' type='text/css'>
+
+
+
+
+
+
+
+
+
+ <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
+
+
+
+ <link rel="top" title="Apache Tajo 0.11.0 documentation"
href="index.html"/>
+ <link rel="next" title="Index (Experimental Feature)"
href="index_overview.html"/>
+ <link rel="prev" title="Hash Partitioning"
href="partitioning/hash_partitioning.html"/>
+
+
+ <script
src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
+
+</head>
+
+<body class="wy-body-for-nav" role="document">
+
+ <div class="wy-grid-for-nav">
+
+
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
+ <div class="wy-side-nav-search">
+ <a href="index.html" class="fa fa-home"> Apache Tajo</a>
+ <div role="search">
+ <form id ="rtd-search-form" class="wy-form" action="search.html"
method="get">
+ <input type="text" name="q" placeholder="Search docs" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+</div>
+ </div>
+
+ <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation"
aria-label="main navigation">
+
+
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal"
href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="getting_started.html">Getting Started</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="getting_started.html#prerequisites">Prerequisites</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="getting_started.html#dowload-and-unpack-the-source-code">Dowload and
unpack the source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="getting_started.html#build-source-code">Build source code</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="getting_started.html#setting-up-a-local-tajo-cluster">Setting up a local
Tajo cluster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="getting_started.html#first-query-execution">First query execution</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="configuration.html">Configuration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/preliminary.html">Preliminary</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/cluster_setup.html">Cluster Setup</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/tajo_master_configuration.html">Tajo Master
Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/worker_configuration.html">Worker Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/catalog_configuration.html">Catalog Configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/ha_configuration.html">High Availability for
TajoMaster</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/service_config_defaults.html">Cluster Service Configuration
Defaults</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/tajo-site-xml.html">The tajo-site.xml File</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="configuration/catalog-site-xml.html">The catalog-site.xml File</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="tsql.html">Tajo
Shell (TSQL)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/meta_command.html">Meta Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/dfs_command.html">Executing HDFS commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/variables.html">Session Variables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/admin_command.html">Administration Commands</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/intro.html">Introducing to TSQL</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/single_command.html">Executing a single command</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/execute_file.html">Executing Queries from Files</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="tsql/background_command.html">Executing as background process</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="sql_language.html">SQL Language</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/data_model.html">Data Model</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/ddl.html">Data Definition Language</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/insert.html">INSERT (OVERWRITE) INTO</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/alter_table.html">ALTER TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/queries.html">Queries</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/joins.html">Joins</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/sql_expression.html">SQL Expressions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="sql_language/predicates.html">Predicates</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="time_zone.html">Time Zone</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="time_zone.html#server-cluster-time-zone">Server Cluster Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="time_zone.html#table-time-zone">Table Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="time_zone.html#client-time-zone">Client Time Zone</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="time_zone.html#time-zone-id">Time Zone ID</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="time_zone.html#examples-of-time-zone">Examples of Time Zone</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="functions.html">Functions</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="functions.html#built-in-functions">Built-in Functions</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="functions.html#user-defined-functions">User-defined Functions</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="table_management.html">Table Management</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="table_management/table_overview.html">Overview of Tajo Tables</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="table_management/tablespaces.html">Tablespaces</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="table_management/file_formats.html">File Formats</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="table_management/compression.html">Compression</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="table_partitioning.html">Table Partitioning</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="partitioning/intro_to_partitioning.html">Introduction to
Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="partitioning/column_partitioning.html">Column Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="partitioning/range_partitioning.html">Range Partitioning</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="partitioning/hash_partitioning.html">Hash Partitioning</a></li>
+</ul>
+</li>
+<li class="toctree-l1 current"><a class="current reference internal"
href="">Storage Plugin</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="#overview">Overview</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="#register-custom-storage">Register custom storage</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="#configuration">Configuration</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="index_overview.html">Index (Experimental Feature)</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="index/types.html">Index Types</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="index/how_to_use.html">How to use index?</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="index/future_work.html">Future Works</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="backup_and_restore.html">Backup and Restore</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="backup_and_restore/catalog.html">Backup and Restore Catalog</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="hive_integration.html">Hive Integration</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="hbase_integration.html">HBase Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="hbase_integration.html#create-table">CREATE TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="hbase_integration.html#drop-table">DROP TABLE</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="hbase_integration.html#insert-overwrite-into">INSERT (OVERWRITE)
INTO</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="hbase_integration.html#usage">Usage</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="swift_integration.html">OpenStack Swift Integration</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="swift_integration.html#swift-configuration">Swift configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="swift_integration.html#hadoop-configurations">Hadoop
configurations</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="swift_integration.html#tajo-configuration">Tajo configuration</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="swift_integration.html#querying-on-swift">Querying on Swift</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="jdbc_driver.html">Tajo JDBC Driver</a><ul>
+<li class="toctree-l2"><a class="reference internal"
href="jdbc_driver.html#how-to-get-jdbc-driver">How to get JDBC driver</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="jdbc_driver.html#setting-the-classpath">Setting the CLASSPATH</a></li>
+<li class="toctree-l2"><a class="reference internal"
href="jdbc_driver.html#an-example-jdbc-client">An Example JDBC Client</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal"
href="tajo_client_api.html">Tajo Client API</a></li>
+<li class="toctree-l1"><a class="reference internal"
href="faq.html">FAQ</a></li>
+</ul>
+
+
+ </div>
+
+ </nav>
+
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
+
+
+ <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">Apache Tajo</a>
+ </nav>
+
+
+
+ <div class="wy-nav-content">
+ <div class="rst-content">
+ <div role="navigation" aria-label="breadcrumbs navigation">
+ <ul class="wy-breadcrumbs">
+ <li><a href="index.html">Docs</a> »</li>
+
+ <li>Storage Plugin</li>
+ <li class="wy-breadcrumbs-aside">
+
+ <a href="_sources/storage_plugin.txt" rel="nofollow"> View page
source</a>
+
+ </li>
+ </ul>
+ <hr/>
+</div>
+ <div role="main">
+
+ <div class="section" id="storage-plugin">
+<h1>Storage Plugin<a class="headerlink" href="#storage-plugin"
title="Permalink to this headline">¶</a></h1>
+<div class="section" id="overview">
+<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this
headline">¶</a></h2>
+<p>Tajo supports various storage systems, such as HDFS, Amazon S3, Openstack
Swift, and HBase. Also, we have a plan to support RDBMS storages like Oracle,
MySQL, PostgreSQL. Tajo already embeds HDFS, S3, Openstack, and HBase, and also
Tajo allows users to register custom storages and data formats to Tajo cluster
instances. This section describes how you register custom storages and data
types.</p>
+</div>
+<div class="section" id="register-custom-storage">
+<h2>Register custom storage<a class="headerlink"
href="#register-custom-storage" title="Permalink to this headline">¶</a></h2>
+<p>First of all, your storage implementation should be packed as a jar file.
Then, please copy the jar file into <code class="docutils literal"><span
class="pre">tajo/extlib</span></code> directory. Next, you should copy <code
class="docutils literal"><span
class="pre">conf/storage-site.json.template</span></code> into <code
class="docutils literal"><span class="pre">conf/storage-site.json</span></code>
and modify the file like the below.</p>
+</div>
+<div class="section" id="configuration">
+<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink
to this headline">¶</a></h2>
+<p>Tajo has a default configuration for builtin storages, such as HDFS, local
file system, and Amazon S3. it also allows users to add custom storage
plugins</p>
+<p><code class="docutils literal"><span
class="pre">conf/storage-site.json</span></code> file has the following
struct:</p>
+<div class="highlight-json"><div class="highlight"><pre><span
class="p">{</span>
+ <span class="nt">"storages"</span><span class="p">:</span> <span
class="p">{</span>
+ <span class="nt">"${scheme}"</span><span class="p">:</span>
<span class="p">{</span>
+ <span class="nt">"handler"</span><span class="p">:</span>
<span class="s2">"${class name}"</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Each storage instance (i.e., <a class="reference internal"
href="table_management/tablespaces.html"><em>Tablespaces</em></a>) is
identified by an URI. The scheme of URI plays a role to identify storage type.
For example, <code class="docutils literal"><span
class="pre">hdfs://</span></code> is used for Hdfs storage, <code
class="docutils literal"><span class="pre">jdbc://</span></code> is used for
JDBC-based storage, and <code class="docutils literal"><span
class="pre">hbase://</span></code> is used for HBase storage.</p>
+<p>You should substitute a scheme name without <code class="docutils
literal"><span class="pre">://</span></code> for <code class="docutils
literal"><span class="pre">${scheme}</span></code>.</p>
+<p>See an example for HBase storage.</p>
+<div class="highlight-json"><div class="highlight"><pre><span
class="p">{</span>
+ <span class="nt">"storages"</span><span class="p">:</span> <span
class="p">{</span>
+ <span class="nt">"hbase"</span><span class="p">:</span> <span
class="p">{</span>
+ <span class="nt">"handler"</span><span class="p">:</span>
<span
class="s2">"org.apache.tajo.storage.hbase.HBaseTablespace"</span><span
class="p">,</span>
+ <span class="nt">"default-format"</span><span
class="p">:</span> <span class="s2">"hbase"</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</div>
+
+
+ </div>
+ <footer>
+
+ <div class="rst-footer-buttons" role="navigation" aria-label="footer
navigation">
+
+ <a href="index_overview.html" class="btn btn-neutral float-right"
title="Index (Experimental Feature)"/>Next <span class="fa
fa-arrow-circle-right"></span></a>
+
+
+ <a href="partitioning/hash_partitioning.html" class="btn btn-neutral"
title="Hash Partitioning"><span class="fa fa-arrow-circle-left"></span>
Previous</a>
+
+ </div>
+
+
+ <hr/>
+
+ <div role="contentinfo">
+ <p>
+ © Copyright 2014, Apache Tajo Team.
+ </p>
+ </div>
+
+ <a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>
+</footer>
+ </div>
+ </div>
+
+ </section>
+
+ </div>
+
+
+
+
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT:'./',
+ VERSION:'0.11.0',
+ 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/theme.js"></script>
+
+
+
+
+ <script type="text/javascript">
+ jQuery(function () {
+ SphinxRtdTheme.StickyNav.enable();
+ });
+ </script>
+
+
+</body>
+</html>
\ No newline at end of file