Skip to content
Advertisement

Hive describe extended table return json

Is there any way to run “describe extended table” in Hive and have the results returned in JSON, XML, or some easily parsed format? Or is there an existing parse in Java that can parse this type of format?

Table(tableName:test3, dbName:testdatabase, owner:johnsmith, createTime:1481135997, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:a, type:string, comment:””a,m)], location:hdfs://testcluster/apps/hive/warehouse/testdatabase/test3, inputFormat:org.apache.hadoop.hive.ql.io.orc.OrcInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.ql.io.orc.OrcSerde, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{totalSize=0, numRows=0, rawDataSize=0, COLUMN_STATS_ACCURATE={“BASIC_STATS”:”true”}, numFiles=0, transient_lastDdlTime=1481135997}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)

Advertisement

Answer

DESCRIBE FORMATTED my_table; is more friendly
not json or xml.. but more readable than DESCRIBE EXTENDED my_table;

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement