Added: tajo/site/docs/0.11.1/sql_language/sql_expression.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/sql_language/sql_expression.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/sql_language/sql_expression.html (added) +++ tajo/site/docs/0.11.1/sql_language/sql_expression.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,333 @@ + + + + + + + + + + SQL Expressions — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

SQL Expressions¶

+
+

Arithmetic Expressions¶

+
+
+

Type Casts¶

+

A type cast converts a specified-typed data to another-typed data. Tajo has two type cast syntax:

+
CAST ( expression AS type )
+expression::type
+
+
+

In addition, several functions are provided for type conversion. Please refer to Data Type Functions and Operators and DateTime Functions and Operators.

+
+
+

String Literals¶

+

A string constant is an arbitrary sequence of characters bounded by single quotes ('):

+
'tajo'
+
+
+
+
+

Function Calls¶

+

The syntax for a function call consists of the name of a function and its argument list enclosed in parentheses:

+
function_name ([expression [, expression ... ]] )
+
+
+

For more information about functions, please refer to Functions.

+
+
+

Window Function Calls¶

+

A window function call performs aggregate operation across the window which is a set of rows that are related to the current row. An window function has the following syntax.

+
function_name OVER ( window_definition )
+
+
+

where function_name is the name of aggregation function. Any aggregation function or window function can be used. For built-in aggregation functions and window functions, please refer to Aggregation Functions and Window Functions.

+

window_definition has the following syntax.

+
[ PARTITION BY expression [, ...] ]
+[ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ]
+
+
+

In the above syntax, expression can be any expression except window function call itself. +PARTITION BY and ORDER BY lists have the same syntax and semantics as GROUP BY and ORDER BY clauses. +That is, PARTITION BY list describes how the output result will be partitioned like GROUP BY clause creates multiple partitions according to the value of its expression. +With ORDER BY list, result values are sorted in each partition.

+

Here are some examples.

+
select l_orderkey, count(*) as cnt, row_number() over (order by count(*) desc) row_num from lineitem group by l_orderkey order by l_orderkey;
+
+select o_custkey, o_orderstatus, sum(o_totalprice) over (partition by o_custkey) as price from orders;
+
+select l_linenumber, l_tax, sum(l_quantity) over (partition by l_linenumber order by l_tax desc) as quantity, avg(l_extendedprice) over (partition by l_shipdate) from lineitem order by l_tax;
+
+
+
+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/storage_plugins.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/storage_plugins.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/storage_plugins.html (added) +++ tajo/site/docs/0.11.1/storage_plugins.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,285 @@ + + + + + + + + + + Storage Plugin — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Storage Plugin¶

+

This section describes the storage plugins available in Tajo to access datasets from different data sources.

+ +
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/storage_plugins/overview.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/storage_plugins/overview.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/storage_plugins/overview.html (added) +++ tajo/site/docs/0.11.1/storage_plugins/overview.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,316 @@ + + + + + + + + + + Storage Plugin Overview — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Storage Plugin Overview¶

+
+

Overview¶

+

Tajo supports various storage systems, such as HDFS, Amazon S3, Openstack Swift, HBase, and RDBMS. Tajo already embeds HDFS, S3, Openstack, HBase, RDBMS storage plugins, 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:

+
{
+  "storages": {
+    "${scheme}": {
+      "handler": "${class name}"
+    }
+  }
+}
+
+
+

Each storage instance (i.e., 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.

+
{
+  "storages": {
+    "hbase": {
+      "handler": "org.apache.tajo.storage.hbase.HBaseTablespace",
+      "default-format": "hbase"
+    }
+  }
+}
+
+
+
+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/storage_plugins/postgresql.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/storage_plugins/postgresql.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/storage_plugins/postgresql.html (added) +++ tajo/site/docs/0.11.1/storage_plugins/postgresql.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,313 @@ + + + + + + + + + + PostgreSQL Storage Handler — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

PostgreSQL Storage Handler¶

+
+

Overview¶

+

PostgreSQL storage handler is available by default in Tajo. It enables users’ queries to access database objects in PostgreSQL. Tables in PostgreSQL will be shown as tables in Tajo too. Most of the SQL queries used for PostgreSQL are available in Tajo via this storage handles. Its main advantages is to allow federated query processing among tables in stored HDFS and PostgreSQL.

+
+
+

Configuration¶

+

PostgreSQL storage handler is a builtin storage handler. So, you can eaisly register PostgreSQL databases to a Tajo cluster if you just add the following line to conf/storage-site.json file. If you want to know more information about storage-site.json, please refer to Tablespaces.

+
{
+  "spaces": {
+    "pgsql_db1": {
+      "uri": "jdbc:postgresql://hostname:port/db1"
+
+      "configs": {
+        "mapped_database": "tajo_db1"
+        "connection_properties": {
+          "user":     "tajo",
+          "password": "xxxx"
+        }
+      }
+    }
+  }
+}
+
+
+

configs allows users to specific additional configurations. +mapped_database specifies a database name shown in Tajo. In the example, the database db1 in PostgreSQL +will be mapped to the database tajo_db1 in Tajo. +connection_properties allows users to set JDBC connection parameters. +Please refer to https://jdbc.postgresql.org/documentation/head/connect.html in order to know the details of +PostgreSQL connection parameters.

+

The storage-site.json will be effective after you restart a tajo cluster.

+
+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file