python sqlalchemy get result'describe extended< table>'到dict

bbmckpt7  于 2021-06-24  发布在  Hive
关注(0)|答案(0)|浏览(189)
Table(tableName:partitiontest, dbName:default, owner:root, createTime:1593582130, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:name, type:string, comment:null), FieldSchema(name:uid, type:string, comment:null)], location:hdfs://namenode:8020/user/hive/warehouse/partitiontest, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[FieldSchema(name:uid, type:string, comment:null)], parameters:{totalSize=20, numRows=2, rawDataSize=18, COLUMN_STATS_ACCURATE={"BASIC_STATS":"true"}, numFiles=2, numPartitions=2, transient_lastDdlTime=1593582130}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE, rewriteEnabled:false)

我通过查询得到了这个结果 describe extended <table> 获取列信息(名称、类型、注解)、tablename、dbname、createtime、tablecomment。
有没有办法将字符串转换成json或dict。我不能更改配置单元的配置。另外,我无法访问配置单元的metastore db。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题