Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/756#discussion_r40056645
  
    --- Diff: tajo-docs/src/main/sphinx/table_management/json.rst ---
    @@ -0,0 +1,100 @@
    +****
    +JSON
    +****
    +
    +JSON(JavaScript Object Notation) is an open standard format for data 
(de)serialization. Since it is simple and human-readable, it is popularly used 
in many fields.
    +Tajo supports JSON as its data format. In this section, you will get an 
overview of how to create JSON tables and query on them.
    +
    +============================
    +How to Create a JSON Table ?
    +============================
    +
    +You can create JSON tables using ``CREATE TABLE`` statement. (For more 
information, please refer to :doc:`/sql_language/ddl`.)
    +For example, please consider an example data as follows:
    +
    +.. code-block:: bash
    +
    +  $ hdfs dfs -cat /table1/table.json
    +  { "title" : "Hand of the King", "name" : { "first_name": "Eddard", 
"last_name": "Stark"}}
    +  { "title" : "Assassin", "name" : { "first_name": "Arya", "last_name": 
"Stark"}}
    +  { "title" : "Dancing Master", "name" : { "first_name": "Syrio", 
"last_name": "Forel"}}
    +
    +Tajo provides two alternatives to create a table for this data. First is a 
traditional way to create tables. Here is an example.
    +
    +.. code-block:: sql
    +
    +  CREATE EXTERNAL TABLE table1 (
    +    title TEXT,
    +    name RECORD (
    +      first_name TEXT,
    +      last_name TEXT
    +    )
    +  ) USING JSON LOCATION '/table1/table.json';
    +
    +With this way, you need to specify every column which they want to use. 
This will be a tedious work, and not appropriate for flexible JSON schema.
    +Second is a simpler alternative to alleviate this problem. When you create 
an external table of JSON format, you can simply omit the column specification 
as follows:
    +
    +.. code-block:: sql
    +
    +  CREATE EXTERNAL TABLE table1 USING JSON LOCATION '/table1/table.json';
    --- End diff --
    
    It needs to reflect the changed schema description way; i.e., ``(*)``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to