org.apache.hadoop.hive.ql.metadata.formatting
Class JsonMetaDataFormatter

java.lang.Object
  extended by org.apache.hadoop.hive.ql.metadata.formatting.JsonMetaDataFormatter
All Implemented Interfaces:
MetaDataFormatter

public class JsonMetaDataFormatter
extends Object
implements MetaDataFormatter

Format table and index information for machine readability using json.


Constructor Summary
JsonMetaDataFormatter()
           
 
Method Summary
 void describeTable(DataOutputStream out, String colPath, String tableName, Table tbl, Partition part, List<org.apache.hadoop.hive.metastore.api.FieldSchema> cols, boolean isFormatted, boolean isExt, boolean isPretty, boolean isOutputPadded)
          Describe table.
 void error(OutputStream out, String msg, int errorCode, String sqlState)
          Write an error message.
 void error(OutputStream out, String errorMessage, int errorCode, String sqlState, String errorDetail)
           
 void showDatabaseDescription(DataOutputStream out, String database, String comment, String location, String ownerName, String ownerType, Map<String,String> params)
          Show the description of a database
 void showDatabases(DataOutputStream out, List<String> databases)
          Show a list of databases
 void showTablePartitons(DataOutputStream out, List<String> parts)
          Show the table partitions.
 void showTables(DataOutputStream out, Set<String> tables)
          Show a list of tables.
 void showTableStatus(DataOutputStream out, Hive db, HiveConf conf, List<Table> tbls, Map<String,String> part, Partition par)
          Show the table status.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonMetaDataFormatter

public JsonMetaDataFormatter()
Method Detail

error

public void error(OutputStream out,
                  String msg,
                  int errorCode,
                  String sqlState)
           throws HiveException
Write an error message.

Specified by:
error in interface MetaDataFormatter
sqlState - if null, will be ignored
Throws:
HiveException

error

public void error(OutputStream out,
                  String errorMessage,
                  int errorCode,
                  String sqlState,
                  String errorDetail)
           throws HiveException
Specified by:
error in interface MetaDataFormatter
sqlState - if null, will be skipped in output
errorDetail - usually string version of some Exception, if null, will be ignored
Throws:
HiveException

showTables

public void showTables(DataOutputStream out,
                       Set<String> tables)
                throws HiveException
Show a list of tables.

Specified by:
showTables in interface MetaDataFormatter
Throws:
HiveException

describeTable

public void describeTable(DataOutputStream out,
                          String colPath,
                          String tableName,
                          Table tbl,
                          Partition part,
                          List<org.apache.hadoop.hive.metastore.api.FieldSchema> cols,
                          boolean isFormatted,
                          boolean isExt,
                          boolean isPretty,
                          boolean isOutputPadded)
                   throws HiveException
Describe table.

Specified by:
describeTable in interface MetaDataFormatter
isFormatted - - describe with formatted keyword
isOutputPadded - - if true, add spacing and indentation
Throws:
HiveException

showTableStatus

public void showTableStatus(DataOutputStream out,
                            Hive db,
                            HiveConf conf,
                            List<Table> tbls,
                            Map<String,String> part,
                            Partition par)
                     throws HiveException
Description copied from interface: MetaDataFormatter
Show the table status.

Specified by:
showTableStatus in interface MetaDataFormatter
Throws:
HiveException

showTablePartitons

public void showTablePartitons(DataOutputStream out,
                               List<String> parts)
                        throws HiveException
Show the table partitions.

Specified by:
showTablePartitons in interface MetaDataFormatter
Throws:
HiveException

showDatabases

public void showDatabases(DataOutputStream out,
                          List<String> databases)
                   throws HiveException
Show a list of databases

Specified by:
showDatabases in interface MetaDataFormatter
Throws:
HiveException

showDatabaseDescription

public void showDatabaseDescription(DataOutputStream out,
                                    String database,
                                    String comment,
                                    String location,
                                    String ownerName,
                                    String ownerType,
                                    Map<String,String> params)
                             throws HiveException
Show the description of a database

Specified by:
showDatabaseDescription in interface MetaDataFormatter
Throws:
HiveException


Copyright © 2014 The Apache Software Foundation. All rights reserved.