apache / apache/paimon

[Bug] Hive SQL "describe extended tableName" does not contain primary key information

Open
#2,643 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/incubator-paimon/issues) and found nothing similar.

### Paimon version

0.6

### Compute Engine

Hive

### Minimal reproduce step

Spark sql 创建表:
```sql
create table if not exists bigdata.paimon_sample (
k int,
v string
) USING paimon
tblproperties (
'primary-key' = 'k'
)
```

执行 hive sql,没有显示primary-key 信息:
```
hive> describe extended paimon_sample;
OK
k int from deserializer
v string from deserializer

Detailed Table Information Table(tableName:paimon_sample, dbName:bigdata, owner:melin, createTime:1704431463, lastAccessTime:1704431463, retention:2147483647, sd:StorageDescriptor(cols:[FieldSchema(name:k, type:int, comment:null), FieldSchema(name:v, type:string, comment:null)], location:hdfs://cdh1:8020/user/hive/warehouse/bigdata.db/paimon_sample, inputFormat:org.apache.paimon.hive.mapred.PaimonInputFormat, outputFormat:org.apache.paimon.hive.mapred.PaimonOutputFormat, compressed:false, numBuckets:0, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.paimon.hive.PaimonSerDe, parameters:{}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{transient_lastDdlTime=1704431463, totalSize=340, storage_handler=org.apache.paimon.hive.PaimonStorageHandler, numFilesErasureCoded=0, numFiles=1}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE, ownerType:USER)
Time taken: 0.858 seconds, Fetched: 4 row(s)
hive> show create table paimon_sample;
OK
CREATE TABLE `paimon_sample`(
`k` int COMMENT 'from deserializer',
`v` string COMMENT 'from deserializer')
ROW FORMAT SERDE
'org.apache.paimon.hive.PaimonSerDe'
STORED BY
'org.apache.paimon.hive.PaimonStorageHandler'

LOCATION
'hdfs://cdh1:8020/user/hive/warehouse/bigdata.db/paimon_sample'
TBLPROPERTIES (
'transient_lastDdlTime'='1704431463')
Time taken: 0.183 seconds, Fetched: 12 row(s)
hive>
```

### What doesn't meet your expectations?

执行describe extended paimon_sample ,返回信息包含主键字段

@YannByron

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report using the shown Spark SQL CREATE TABLE statement, then run Hive's `describe extended` and `show create table` commands. Trace the Hive integration points named in the output, including PaimonStorageHandler and PaimonSerDe, to determine where primary-key metadata should be exposed. Done means `describe extended paimon_sample` includes the `k` primary-key field.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.