trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.41k stars 3k forks source link

Unable to create table with name > 128 on Hive Thrift metastore #23075

Open jinyangli34 opened 2 months ago

jinyangli34 commented 2 months ago

Recently hit a problem when using table with name length > 128. Failed to create table due to HMS SERDES.NAME column restriction:

Caused by: io.trino.hive.thrift.metastore.MetaException: Attempt to store value "jl_name_129_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" in column "`NAME`" that has maximum length of 128. Please correct your data!

Any reason we need to set tableName as serdeName? https://github.com/trinodb/trino/blob/074fef44233ab26c535b200a5af3f6359a0935d8/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/thrift/ThriftMetastoreUtil.java#L685

hashhar commented 1 month ago

Any reason we need to set tableName as serdeName?

Because that's the default Hive behaviour according to https://github.com/apache/hive/blob/04bb92ae6174d2953f42801593b1b709bcf1154c/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift#L442-L450.