Added: tajo/site/docs/0.10.1/_sources/table_management/table_overview.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/table_management/table_overview.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/table_management/table_overview.txt (added) +++ tajo/site/docs/0.10.1/_sources/table_management/table_overview.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,63 @@ +************************************* +Overview of Tajo Tables +************************************* + +Overview +======== + +Managed Table +================ + +.. todo:: + +External Table +================ + +.. todo:: + +Table Properties +================ +All table formats provide parameters for enabling or disabling features and adjusting physical parameters. +The ``WITH`` clause in the CREATE TABLE statement allows users to set those properties. + +The following example is to set a custom field delimiter, NULL character, and compression codec: + +.. code-block:: sql + + CREATE TABLE table1 ( + id int, + name text, + score float, + type text + ) USING TEXT WITH('text.delimiter'='\u0001', + 'text.null'='\\N', + 'compression.codec'='org.apache.hadoop.io.compress.SnappyCodec'); + +Each physical table layout has its own specialized properties. They will be addressed in :doc:`/table_management/file_formats`. + + +Common Table Properties +======================= + +There are some common table properties which are used in most tables. + +Compression +----------- +.. todo:: + +Time zone +--------- + +In Tajo, a table property ``timezone`` allows users to specify a time zone that the table uses for reading or writing. + +You can specify a table time zone as follows: + +.. code-block:: sql + + CREATE EXTERNAL TABLE table1 ( + t_timestamp TIMESTAMP, + t_date DATE + ) USING TEXT WITH('timezone'='ASIA/Seoul') LOCATION '/path-to-table/' + + +In order to learn time zone, please refer to :doc:`/time_zone`.
Added: tajo/site/docs/0.10.1/_sources/table_management/text.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/table_management/text.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/table_management/text.txt (added) +++ tajo/site/docs/0.10.1/_sources/table_management/text.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,115 @@ +************************************* +TEXT +************************************* + +A character-separated values plain-text file represents a tabular data set consisting of rows and columns. +Each row is a plan-text line. A line is usually broken by a character line feed ``\n`` or carriage-return ``\r``. +The line feed ``\n`` is the default delimiter in Tajo. Each record consists of multiple fields, separated by +some other character or string, most commonly a literal vertical bar ``|``, comma ``,`` or tab ``\t``. +The vertical bar is used as the default field delimiter in Tajo. + +========================================= +How to Create a TEXT Table ? +========================================= + +If you are not familiar with the ``CREATE TABLE`` statement, please refer to the Data Definition Language :doc:`/sql_language/ddl`. + +In order to specify a certain file format for your table, you need to use the ``USING`` clause in your ``CREATE TABLE`` +statement. The below is an example statement for creating a table using *TEXT* format. + +.. code-block:: sql + + CREATE TABLE + table1 ( + id int, + name text, + score float, + type text + ) USING TEXT; + +========================================= +Physical Properties +========================================= + +Some table storage formats provide parameters for enabling or disabling features and adjusting physical parameters. +The ``WITH`` clause in the CREATE TABLE statement allows users to set those parameters. + +*TEXT* format provides the following physical properties. + +* ``text.delimiter``: delimiter character. ``|`` or ``\u0001`` is usually used, and the default field delimiter is ``|``. +* ``text.null``: ``NULL`` character. The default ``NULL`` character is an empty string ``''``. Hive's default ``NULL`` character is ``'\\N'``. +* ``compression.codec``: Compression codec. You can enable compression feature and set specified compression algorithm. The compression algorithm used to compress files. The compression codec name should be the fully qualified class name inherited from `org.apache.hadoop.io.compress.CompressionCodec <https://hadoop.apache.org/docs/current/api/org/apache/hadoop/io/compress/CompressionCodec.html>`_. By default, compression is disabled. +* ``text.serde``: custom (De)serializer class. ``org.apache.tajo.storage.text.CSVLineSerDe`` is the default (De)serializer class. +* ``timezone``: the time zone that the table uses for writting. When table rows are read or written, ```timestamp``` and ```time``` column values are adjusted by this timezone if it is set. Time zone can be an abbreviation form like 'PST' or 'DST'. Also, it accepts an offset-based form like 'UTC+9' or a location-based form like 'Asia/Seoul'. +* ``text.error-tolerance.max-num``: the maximum number of permissible parsing errors. This value should be an integer value. By default, ``text.error-tolerance.max-num`` is ``0``. According to the value, parsing errors will be handled in different ways. + * If ``text.error-tolerance.max-num < 0``, all parsing errors are ignored. + * If ``text.error-tolerance.max-num == 0``, any parsing error is not allowed. If any error occurs, the query will be failed. (default) + * If ``text.error-tolerance.max-num > 0``, the given number of parsing errors in each task will be pemissible. + +The following example is to set a custom field delimiter, ``NULL`` character, and compression codec: + +.. code-block:: sql + + CREATE TABLE table1 ( + id int, + name text, + score float, + type text + ) USING TEXT WITH('text.delimiter'='\u0001', + 'text.null'='\\N', + 'compression.codec'='org.apache.hadoop.io.compress.SnappyCodec'); + +.. warning:: + + Be careful when using ``\n`` as the field delimiter because *TEXT* format tables use ``\n`` as the line delimiter. + At the moment, Tajo does not provide a way to specify the line delimiter. + +========================================= +Custom (De)serializer +========================================= + +The *TEXT* format not only provides reading and writing interfaces for text data but also allows users to process custom +plan-text file formats with user-defined (De)serializer classes. +For example, with custom (de)serializers, Tajo can process JSON file formats or any specialized plan-text file formats. + +In order to specify a custom (De)serializer, set a physical property ``text.serde``. +The property value should be a fully qualified class name. + +For example: + +.. code-block:: sql + + CREATE TABLE table1 ( + id int, + name text, + score float, + type text + ) USING TEXT WITH ('text.serde'='org.my.storage.CustomSerializerDeserializer') + + +========================================= +Null Value Handling Issues +========================================= +In default, ``NULL`` character in *TEXT* format is an empty string ``''``. +In other words, an empty field is basically recognized as a ``NULL`` value in Tajo. +If a field domain is ``TEXT``, an empty field is recognized as a string value ``''`` instead of ``NULL`` value. +Besides, You can also use your own ``NULL`` character by specifying a physical property ``text.null``. + +========================================= +Compatibility Issues with Apache Hive⢠+========================================= + +*TEXT* tables generated in Tajo can be processed directly by Apache Hive⢠without further processing. +In this section, we explain some compatibility issue for users who use both Hive and Tajo. + +If you set a custom field delimiter, the *TEXT* tables cannot be directly used in Hive. +In order to specify the custom field delimiter in Hive, you need to use ``ROW FORMAT DELIMITED FIELDS TERMINATED BY`` +clause in a Hive's ``CREATE TABLE`` statement as follows: + +.. code-block:: sql + + CREATE TABLE table1 (id int, name string, score float, type string) + ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' + STORED AS TEXT + +To the best of our knowledge, there is not way to specify a custom ``NULL`` character in Hive. Added: tajo/site/docs/0.10.1/_sources/table_partitioning.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/table_partitioning.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/table_partitioning.txt (added) +++ tajo/site/docs/0.10.1/_sources/table_partitioning.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,11 @@ +****************** +Table Partitioning +****************** + +.. toctree:: + :maxdepth: 1 + + partitioning/intro_to_partitioning + partitioning/column_partitioning + partitioning/range_partitioning + partitioning/hash_partitioning \ No newline at end of file Added: tajo/site/docs/0.10.1/_sources/tajo_client_api.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tajo_client_api.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tajo_client_api.txt (added) +++ tajo/site/docs/0.10.1/_sources/tajo_client_api.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,5 @@ +************************************* +Tajo Client API +************************************* + +.. todo:: \ No newline at end of file Added: tajo/site/docs/0.10.1/_sources/time_zone.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/time_zone.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/time_zone.txt (added) +++ tajo/site/docs/0.10.1/_sources/time_zone.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,129 @@ +****************** +Time Zone +****************** + +Time zone affects some data types (e.g., ``Timestamp`` and ``Time``) and operations (e.g., ``to_char``). Tables can have different time zones. Internally, Tajo translates all table rows to UTC values and processes them. It becomes easier for Tajo to handle multiple different time zones. + +In Tajo, there are some time zong settings. + +======================== +Server Cluster Time Zone +======================== + +One Tajo cluster has a system time zone which globally affects all tables in which the table property 'time zone' are not specified. + +You can set the system time zone in *conf/tajo-site.xml* file as follows: + +**tajo-site.xml** + +.. code-block:: xml + + <name>tajo.timezone</name> + <property>GMT+9</property> + + +================== +Table Time Zone +================== + +In Tajo, a table property ``timezone`` allows users to specify a time zone that the table uses for reading or writing. +When each table row are read or written, ```timestamp``` and ```time``` column values are adjusted by a given time zone if it is set. + +You can specify a table time zone as follows: + +.. code-block:: sql + + CREATE EXTERNAL TABLE table1 ( + t_timestamp TIMESTAMP, + t_date DATE + ) USING TEXT WITH('timezone'='ASIA/Seoul') LOCATION '/path-to-table/' + + +In order to learn table properties, please refer to :doc:`/table_management/table_overview`. + +================== +Client Time Zone +================== + +Each client has its own time zone setting. It translates retrieved timestamp and time values by time zone. In order to set client time zone, you should set the session variable ``TIMEZONE``. There are some ways to set this session variable. + +In ``tsql``, you can use ``\set timezone`` meta command as follows: + +**tsql** + +.. code-block:: sh + + default> \set timezone GMT+9 + + +The following ways use SQL statements. So, this way is available in ``tsql``, JDBC, and Tajo Java API. + +**SQL** + +.. code-block:: sql + + SET TIME ZONE 'GMT+9'; + + or + + SET SESSION TIMEZONE TO 'GMT+9'; + +============ +Time Zone ID +============ + +Time zone can be an abbreviation form like 'PST' or 'DST'. Also, it accepts an offset-based form like 'GMT+9' or UTC+9' or a location-based form like 'Asia/Seoul'. + +.. note:: + + In many cases, offset-based forms or locaion-based forms are recommanded. In order to know the list of time zones, please refer to `List of tz database time zones <http://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_ + +.. note:: + + Java 6 does not recognize many location-based time zones and an offset-based timezone using the prefix 'UTC'. We highly recommanded using the offset-based time zone using the prefix 'GMT'. In other words, you should use 'GMT-7' instead of 'UTC-7' in Java 6. + +===================== +Examples of Time Zone +===================== + +For example, consider that there is a list of delimited text lines where each rows are written with ``Asia/Seoul`` time zone (i.e., GMT + 9). + +.. code-block:: text + + 1980-4-1 01:50:30.010|1980-04-01 + 80/4/1 1:50:30 AM|80/4/1 + 1980 April 1 1:50:30|1980-04-01 + + +In order to register the table, we should put a table property ``'timezone'='Asia/Seoul'`` in ``CREATE TABLE`` statement as follows: + +.. code-block:: sql + + CREATE EXTERNAL TABLE table1 ( + t_timestamp TIMESTAMP, + t_date DATE + ) USING TEXT WITH('text.delimiter'='|', 'timezone'='ASIA/Seoul') LOCATION '/path-to-table/' + + +By default, ``tsql`` and ``TajoClient`` API use UTC time zone. So, timestamp values in the result are adjusted by the time zone offset. But, date is not adjusted because date type does not consider time zone. + +.. code-block:: sql + + default> SELECT * FROM table1 + t_timestamp, t_date + ---------------------------------- + 1980-03-31 16:50:30.01, 1980-04-01 + 1980-03-31 16:50:30 , 1980-04-01 + 1980-03-31 16:50:30 , 1980-04-01 + +In addition, users can set client-side time zone by setting a session variable 'TZ'. It enables a client to translate timestamp or time values to user's time zoned ones. + +.. code-block:: sql + + default> SET TIME ZONE 'Asia/Seoul' + default> SELECT * FROM table1 + t_timestamp, t_date + ---------------------------------- + 1980-04-01 01:50:30.01, 1980-04-01 + 1980-04-01 01:50:30 , 1980-04-01 + 1980-04-01 01:50:30 , 1980-04-01 Added: tajo/site/docs/0.10.1/_sources/tsql.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,19 @@ +***************************** +Tajo Shell (TSQL) +***************************** + +Tajo provides a shell utility named Tsql. It is a command-line interface (CLI) where users can create or drop tables, inspect schema and query tables, etc. + +.. toctree:: + :maxdepth: 1 + + tsql/meta_command + tsql/dfs_command + tsql/variables + tsql/admin_command + + + tsql/intro + tsql/single_command + tsql/execute_file + tsql/background_command \ No newline at end of file Added: tajo/site/docs/0.10.1/_sources/tsql/admin_command.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/admin_command.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/admin_command.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/admin_command.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,60 @@ +********************************* +Administration Commands +********************************* + + +========== +Synopsis +========== + +Tsql provides administration commands as follows: + +.. code-block:: sql + + default> \admin; + usage: admin [options] + -cluster Show Cluster Info + -desc Show Query Description + -h,--host <arg> Tajo server host + -kill <arg> Kill a running query + -list Show Tajo query list + -p,--port <arg> Tajo server port + -showmasters gets list of tajomasters in the cluster + + +----------------------------------------------- +Basic usages +----------------------------------------------- + +``-list`` option shows a list of all running queries as follows: :: + + default> \admin -list + QueryId State StartTime Query + -------------------- ------------------- ------------------- ----------------------------- + q_1411357607375_0006 QUERY_RUNNING 2014-09-23 07:19:40 select count(*) from lineitem + + +``-desc`` option shows a detailed description of a specified running query as follows: :: + + default> \admin -desc q_1411357607375_0006 + Id: 1 + Query Id: q_1411357607375_0006 + Started Time: 2014-09-23 07:19:40 + Query State: QUERY_RUNNING + Execution Time: 20.0 sec + Query Progress: 0.249 + Query Statement: + select count(*) from lineitem + + +``-kill`` option kills a specified running query as follows: :: + + default> \admin -kill q_1411357607375_0007 + q_1411357607375_0007 is killed successfully. + + + +``-showmasters`` option shows a list of all tajo masters as follows: :: + + default> \admin -showmasters + grtajo01 Added: tajo/site/docs/0.10.1/_sources/tsql/background_command.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/background_command.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/background_command.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/background_command.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,29 @@ +********************************* +Executing as background process +********************************* + + +If you execute tsql as a background process, tsql will exit before executing a query because of some limitation of Jline2. + +Example: + + .. code-block:: sql + + $ bin/tsql -f aggregation.sql & + [1] 19303 + $ + [1]+ Stopped ./bin/tsql -f aggregation.sql + + +To avoid above problem, Tajo provides the -B command as follows: + +.. code-block:: sql + + $ bin/tsql -B -f aggregation.sql & + [2] 19419 + Progress: 0%, response time: 0.218 sec + Progress: 0%, response time: 0.22 sec + Progress: 0%, response time: 0.421 sec + Progress: 0%, response time: 0.823 sec + Progress: 0%, response time: 1.425 sec + Progress: 1%, response time: 2.227 sec Added: tajo/site/docs/0.10.1/_sources/tsql/dfs_command.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/dfs_command.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/dfs_command.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/dfs_command.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,26 @@ +********************************* +Executing HDFS commands +********************************* + +You can run the hadoop dfs command (FsShell) within tsql. ``\dfs`` command provides a shortcut to the hadoop dfs commands. If you want to use this command, just specify FsShell arguments and add the semicolon at the end as follows: + +.. code-block:: sql + + default> \dfs -ls / + Found 3 items + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo + drwxr-xr-x - tajo supergroup 0 2014-09-04 02:20 /tmp + drwxr-xr-x - tajo supergroup 0 2014-09-16 13:41 /user + + default> \dfs -ls /tajo + Found 2 items + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo/system + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:15 /tajo/warehouse + + default> \dfs -mkdir /tajo/temp + + default> \dfs -ls /tajo + Found 3 items + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:04 /tajo/system + drwxr-xr-x - tajo supergroup 0 2014-09-23 06:48 /tajo/temp + drwxr-xr-x - tajo supergroup 0 2014-08-14 04:15 /tajo/warehouse Added: tajo/site/docs/0.10.1/_sources/tsql/execute_file.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/execute_file.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/execute_file.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/execute_file.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,63 @@ +********************************* +Executing Queries from Files +********************************* + + +----------------------------------------------- +Basic usages +----------------------------------------------- + + +``-f`` command allows tsql to execute more than one SQL statements stored in a text file as follows: + +.. code-block:: sql + + $ cat aggregation.sql + select count(*) from table1; + select sum(score) from table1; + + $ bin/tsql -f aggregation.sql + Progress: 0%, response time: 0.216 sec + Progress: 0%, response time: 0.217 sec + Progress: 100%, response time: 0.331 sec + ?count + ------------------------------- + 5 + (1 rows, 0.331 sec, 2 B selected) + Progress: 0%, response time: 0.203 sec + Progress: 0%, response time: 0.204 sec + Progress: 50%, response time: 0.406 sec + Progress: 100%, response time: 0.769 sec + ?sum + ------------------------------- + 15.0 + (1 rows, 0.769 sec, 5 B selected) + + + +----------------------------------------------- +Setting parameter value in SQL file +----------------------------------------------- + +If you wish to set a parameter value in the SQL file, you can set with the -param key=value option. When you use this feature, you have to use the parameter in the file as follows: + +.. code-block:: sql + + ${paramter name} + + +You have to put the parameter name in braces and you must use the $ symbol for the prefix as follows: + +.. code-block:: sql + + $ cat aggregation.sql + select count(*) from table1 where id = ${p_id}; + + $ bin/tsql -param p_id=1 -f aggregation.sql + Progress: 0%, response time: 0.216 sec + Progress: 0%, response time: 0.217 sec + Progress: 100%, response time: 0.331 sec + ?count + ------------------------------- + 1 + (1 rows, 0.331 sec, 2 B selected) Added: tajo/site/docs/0.10.1/_sources/tsql/intro.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/intro.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/intro.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/intro.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,41 @@ +***************************** +Introducing to TSQL +***************************** + +========== +Synopsis +========== + +.. code-block:: bash + + bin/tsql [options] [database name] + +If a *database_name* is given, tsql connects to the database at startup time. Otherwise, tsql connects to ``default`` database. + +Options + +* ``-c "quoted sql"`` : Execute quoted sql statements, and then the shell will exist. +* ``-f filename (--file filename)`` : Use the file named filename as the source of commands instead of interactive shell. +* ``-h hostname (--host hostname)`` : Specifies the host name of the machine on which the Tajo master is running. +* ``-p port (--port port)`` : Specifies the TCP port. If it is not set, the port will be 26002 by default. +* ``-conf configuration (--conf configuration)`` : Setting Tajo configuration value. +* ``-param parameter (--param parameter)`` : Use a parameter value in SQL file. +* ``-B (--background)`` : Execute as background process. + +=================== +Entering tsql shell +=================== + +If the hostname and the port num are not given, tsql will try to connect the Tajo master specified in ${TAJO_HOME}/conf/tajo-site.xml. :: + + bin/tsql + + default> + +If you want to connect a specified TajoMaster, you should use '-h' and (or) 'p' options as follows: :: + + bin/tsql -h localhost -p 9004 + + default> + +The prompt indicates the current database. Added: tajo/site/docs/0.10.1/_sources/tsql/meta_command.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/meta_command.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/meta_command.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/meta_command.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,150 @@ +********************************* +Meta Commands +********************************* + + +In tsql, any command that begins with an unquoted backslash ('\\') is a tsql meta-command that is processed by tsql itself. + +In the current implementation, there are meta commands as follows: :: + + default> \? + + + General + \copyright show Apache License 2.0 + \version show Tajo version + \? show help + \? [COMMAND] show help of a given command + \help alias of \? + \q quit tsql + + + Informational + \l list databases + \c show current database + \c [DBNAME] connect to new database + \d list tables + \d [TBNAME] describe table + \df list functions + \df NAME describe function + + + Tool + \! execute a linux shell command + \dfs execute a dfs command + \admin execute Tajo admin command + + + Variables + \set [[NAME] [VALUE] set session variable or list session variables + \unset NAME unset session variable + + + Documentations + tsql guide http://tajo.apache.org/docs/current/tsql.html + Query language http://tajo.apache.org/docs/current/sql_language.html + Functions http://tajo.apache.org/docs/current/functions.html + Backup & restore http://tajo.apache.org/docs/current/backup_and_restore.html + Configuration http://tajo.apache.org/docs/current/configuration.html + +----------------------------------------------- +Basic usages +----------------------------------------------- + +``\l`` command shows a list of all databases as follows: :: + + default> \l + default + tpch + work1 + default> + + + +``\d`` command shows a list of tables in the current database as follows: :: + + default> \d + customer + lineitem + nation + orders + part + partsupp + region + supplier + + +``\d [table name]`` command also shows a table description as follows: :: + + default> \d orders + + table name: orders + table path: hdfs:/xxx/xxx/tpch/orders + store type: CSV + number of rows: 0 + volume (bytes): 172.0 MB + schema: + o_orderkey INT8 + o_custkey INT8 + o_orderstatus TEXT + o_totalprice FLOAT8 + o_orderdate TEXT + o_orderpriority TEXT + o_clerk TEXT + o_shippriority INT4 + o_comment TEXT + + + +The prompt ``default>`` indicates the current database. Basically, all SQL statements and meta commands work in the current database. Also, you can change the current database with ``\c`` command. + +.. code-block:: sql + + default> \c work1 + You are now connected to database "test" as user "hyunsik". + work1> + + +``\df`` command shows a list of all built-in functions as follows: :: + + default> \df + Name | Result type | Argument types | Description | Type + -----------------+-----------------+-----------------------+-----------------------------------------------+----------- + abs | INT4 | INT4 | Absolute value | GENERAL + abs | INT8 | INT8 | Absolute value | GENERAL + abs | FLOAT4 | FLOAT4 | Absolute value | GENERAL + abs | FLOAT8 | FLOAT8 | Absolute value | GENERAL + acos | FLOAT8 | FLOAT4 | Inverse cosine. | GENERAL + acos | FLOAT8 | FLOAT8 | Inverse cosine. | GENERAL + utc_usec_to | INT8 | TEXT,INT8 | Extract field from time | GENERAL + utc_usec_to | INT8 | TEXT,INT8,INT4 | Extract field from time | GENERAL + + (181) rows + + For Reference, many details have been omitted in order to present a clear picture of the process. + +``\df [function name]`` command also shows a function description as follows: :: + + default> \df round; + Name | Result type | Argument types | Description | Type + -----------------+-----------------+-----------------------+-----------------------------------------------+----------- + round | INT8 | FLOAT4 | Round to nearest integer. | GENERAL + round | INT8 | FLOAT8 | Round to nearest integer. | GENERAL + round | INT8 | INT4 | Round to nearest integer. | GENERAL + round | INT8 | INT8 | Round to nearest integer. | GENERAL + round | FLOAT8 | FLOAT8,INT4 | Round to s decimalN places. | GENERAL + round | FLOAT8 | INT8,INT4 | Round to s decimalN places. | GENERAL + + (6) rows + + Function: INT8 round(float4) + Description: Round to nearest integer. + Example: + > SELECT round(42.4) + 42 + + Function: FLOAT8 round(float8,int4) + Description: Round to s decimalN places. + Example: + > SELECT round(42.4382, 2) + 42.44 Added: tajo/site/docs/0.10.1/_sources/tsql/single_command.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/single_command.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/single_command.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/single_command.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,24 @@ +********************************* +Executing a single command +********************************* + + +You may want to run more queries without entering tsql prompt. Tsql provides the ``-c`` argument for above requirement. And Tajo assumes that queries are separated by semicolon as follows: + +.. code-block:: sql + + $ bin/tsql -c "select count(*) from table1; select sum(score) from table1;" + Progress: 0%, response time: 0.217 sec + Progress: 0%, response time: 0.218 sec + Progress: 100%, response time: 0.317 sec + ?count + ------------------------------- + 5 + (1 rows, 0.317 sec, 2 B selected) + Progress: 0%, response time: 0.202 sec + Progress: 0%, response time: 0.204 sec + Progress: 100%, response time: 0.345 sec + ?sum + ------------------------------- + 15.0 + (1 rows, 0.345 sec, 5 B selected) Added: tajo/site/docs/0.10.1/_sources/tsql/variables.txt URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_sources/tsql/variables.txt?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_sources/tsql/variables.txt (added) +++ tajo/site/docs/0.10.1/_sources/tsql/variables.txt Tue Jun 30 04:16:52 2015 @@ -0,0 +1,66 @@ +********************************* +Session Variables +********************************* + + +Each client connection to TajoMaster creates a unique session, and the client and TajoMaster uses the session until disconnect. A session provides session variables which are used for various configs per session. + +``tsql`` provides the meta command ``\set`` to manipulate session variables. Just ``\set`` command shows all session variables. :: + + default> \set + 'name1'='val1' + 'name2'='val2' + 'name3'='val3' + ... + +``\set key val`` will set the session variable named *key* with the value *val*. :: + + default> \set + 'CURRENT_DATABASE'='default' + + default> \set key1 val1 + + default> \set + 'CURRENT_DATABASE'='default' + 'key1'='val1' + + +Also, ``\unset key`` will unset the session variable named *key*. + + +Now, tajo provides the following session variables. + +* ``DIST_QUERY_BROADCAST_JOIN_THRESHOLD`` +* ``DIST_QUERY_JOIN_TASK_VOLUME`` +* ``DIST_QUERY_SORT_TASK_VOLUME`` +* ``DIST_QUERY_GROUPBY_TASK_VOLUME`` +* ``DIST_QUERY_JOIN_PARTITION_VOLUME`` +* ``DIST_QUERY_GROUPBY_PARTITION_VOLUME`` +* ``DIST_QUERY_TABLE_PARTITION_VOLUME`` +* ``EXECUTOR_EXTERNAL_SORT_BUFFER_SIZE`` +* ``EXECUTOR_HASH_JOIN_SIZE_THRESHOLD`` +* ``EXECUTOR_INNER_HASH_JOIN_SIZE_THRESHOLD`` +* ``EXECUTOR_OUTER_HASH_JOIN_SIZE_THRESHOLD`` +* ``EXECUTOR_GROUPBY_INMEMORY_HASH_THRESHOLD`` +* ``MAX_OUTPUT_FILE_SIZE`` +* ``CODEGEN`` +* ``CLIENT_SESSION_EXPIRY_TIME`` +* ``CLI_MAX_COLUMN`` +* ``CLI_NULL_CHAR`` +* ``CLI_PRINT_PAUSE_NUM_RECORDS`` +* ``CLI_PRINT_PAUSE`` +* ``CLI_PRINT_ERROR_TRACE`` +* ``CLI_OUTPUT_FORMATTER_CLASS`` +* ``CLI_ERROR_STOP`` +* ``TIMEZONE`` +* ``DATE_ORDER`` +* ``TEXT_NULL`` +* ``DEBUG_ENABLED`` +* ``TEST_BROADCAST_JOIN_ENABLED`` +* ``TEST_JOIN_OPT_ENABLED`` +* ``TEST_FILTER_PUSHDOWN_ENABLED`` +* ``TEST_MIN_TASK_NUM`` +* ``BEHAVIOR_ARITHMETIC_ABORT`` +* ``RESULT_SET_FETCH_ROWNUM`` + + Added: tajo/site/docs/0.10.1/_static/ajax-loader.gif URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/ajax-loader.gif?rev=1688350&view=auto ============================================================================== Binary file - no diff available. Propchange: tajo/site/docs/0.10.1/_static/ajax-loader.gif ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: tajo/site/docs/0.10.1/_static/basic.css URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/basic.css?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_static/basic.css (added) +++ tajo/site/docs/0.10.1/_static/basic.css Tue Jun 30 04:16:52 2015 @@ -0,0 +1,599 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + width: 170px; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + width: 30px; +} + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +div.code-block-caption { + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file Added: tajo/site/docs/0.10.1/_static/comment-bright.png URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/comment-bright.png?rev=1688350&view=auto ============================================================================== Binary file - no diff available. Propchange: tajo/site/docs/0.10.1/_static/comment-bright.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: tajo/site/docs/0.10.1/_static/comment-close.png URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/comment-close.png?rev=1688350&view=auto ============================================================================== Binary file - no diff available. Propchange: tajo/site/docs/0.10.1/_static/comment-close.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: tajo/site/docs/0.10.1/_static/comment.png URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/comment.png?rev=1688350&view=auto ============================================================================== Binary file - no diff available. Propchange: tajo/site/docs/0.10.1/_static/comment.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: tajo/site/docs/0.10.1/_static/css/badge_only.css URL: http://svn.apache.org/viewvc/tajo/site/docs/0.10.1/_static/css/badge_only.css?rev=1688350&view=auto ============================================================================== --- tajo/site/docs/0.10.1/_static/css/badge_only.css (added) +++ tajo/site/docs/0.10.1/_static/css/badge_only.css Tue Jun 30 04:16:52 2015 @@ -0,0 +1 @@ +.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:"\f02d"}.icon-book:bef ore{content:"\f02d"}.fa-caret-down:before{content:"\f0d7"}.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst -versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}
