有什么办法可以知道存储的配置单元表定界符吗?我尝试了Describe扩展,但没有用。.我已经搜索了很多,但尚未获得答案。
最佳答案
我通过使用describe extended table
命令看到
例子:
hive> create table difdelimiter (id int, name string)
row format delimited
fields terminated by ',';
hive> describe extended difdelimiter;
OK id int
name string
Detailed Table Information Table(tableName:difdelimiter, dbName:default, owner:cloudera, createTime:1439375349, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:id, type:int, comment:null), FieldSchema(name:name, type:string, comment:null)], location:hdfs://quickstart.cloudera:8020/user/hive/warehouse/difdelimiter, 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=,, field.delim=,}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{transient_lastDdlTime=1439375349}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) Time taken: 0.154 seconds, Fetched: 4 row(s)
这是有关定界符的信息
parameters:{serialization.format=,, field.delim=,}
根据评论添加
hive> create table tb3 (id int, name string) row format delimited fields terminated by '/t';
OK
Time taken: 0.09 seconds
hive> describe extended tb3;
OK
id int
name string
Detailed Table Information Table(tableName:tb3, dbName:default, owner:cloudera, createTime:1439377591, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:id, type:int, comment:null), FieldSchema(name:name, type:string, comment:null)], location:hdfs://quickstart.cloudera:8020/user/hive/warehouse/tb3, 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=/t, field.delim=/t}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{transient_lastDdlTime=1439377591}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
Time taken: 0.125 seconds, Fetched: 4 row(s)
parameters:{serialization.format=/t, field.delim=/t})