/[Apache-SVN]
ViewVC logotype

Revision 1309666


Jump to revision: Previous Next
Author: hashutosh
Date: Thu Apr 5 06:12:15 2012 UTC (12 years ago)
Changed paths: 20
Log Message:
HIVE-2822 [jira] Add JSON output to the hive ddl commands
(Chris Dean via Ashutosh Chauhan)

Summary:
JSON output for DDL commands

By setting the variable hive.format=json then ddl commands will
produce json output suitable for client side parsing.  For example, to
list all the databases one might get:

    {
      "databases": [
        "default"
      ]
    }

The goal is to have an option to produce JSON output of the DDL commands that is
easily machine parseable.

For example, "desc my_table" currently gives

    id    bigint
    user  string

and we want to allow a json output:

    {
      "columns": [
        {"name": "id", "type": "bigint"},
        {"name": "user", "type": "string"}
      ]
    }

Test Plan: Run the provided unit tests

Reviewers: JIRA, ashutoshc

Reviewed By: ashutoshc

Differential Revision: https://reviews.facebook.net/D2475

Changed paths

Path Details
Directoryhive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java modified , text changed
Directoryhive/trunk/conf/hive-default.xml.template modified , text changed
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java modified , text changed
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java deleted
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/ added
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/JsonMetaDataFormatter.java added
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MapBuilder.java added
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatUtils.java
(Copied from hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/MetaDataFormatUtils.java, r1309624)
added , text changed
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatter.java added
Directoryhive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/TextMetaDataFormatter.java added
Directoryhive/trunk/ql/src/test/queries/clientpositive/describe_database_json.q added
Directoryhive/trunk/ql/src/test/queries/clientpositive/describe_table_json.q added
Directoryhive/trunk/ql/src/test/queries/clientpositive/misc_json.q added
Directoryhive/trunk/ql/src/test/queries/clientpositive/partitions_json.q added
Directoryhive/trunk/ql/src/test/results/clientnegative/database_create_already_exists.q.out modified , text changed
Directoryhive/trunk/ql/src/test/results/clientnegative/database_drop_does_not_exist.q.out modified , text changed
Directoryhive/trunk/ql/src/test/results/clientpositive/describe_database_json.q.out added
Directoryhive/trunk/ql/src/test/results/clientpositive/describe_table_json.q.out added
Directoryhive/trunk/ql/src/test/results/clientpositive/misc_json.q.out added
Directoryhive/trunk/ql/src/test/results/clientpositive/partitions_json.q.out added

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26