Open LauraXia123 opened 2 months ago
main branch
curl 'http://0.0.0.0:3002/api/metalakes/metalake_demo/catalogs/catalog_hive/schemas/sales/tables' \ -H 'Accept: application/vnd.gravitino.v1+json' \ -H 'Accept-Language: zh-CN,zh;q=0.9' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Origin: http://0.0.0.0:3002' \ -H 'Pragma: no-cache' \ -H 'Referer: http://0.0.0.0:3002/catalogs/catalog_hive/sales?catalogType=relational' \ --data-raw '{"name":"table7","comment":"","columns":[{"name":"structComment","type":{"type":"struct","fields":[{"name":"field","type":"binary","nullable":true,"comment":"xxx1111"}]},"nullable":true,"comment":""}],"properties":{}}' \ --insecure
get the response { "code": 0, "table": { "name": "table7", "comment": "", "columns": [ { "name": "structcomment", "type": { "type": "struct", "fields": [ { "name": "field", "type": "binary", "nullable": true } ] }, "comment": "", "nullable": true, "autoIncrement": false } ], "properties": { "input-format": "org.apache.hadoop.mapred.TextInputFormat", "transient_lastDdlTime": "1725612072", "output-format": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat", "location": "hdfs://hive:9000/user/hive/warehouse/sales.db/table7", "table-type": "MANAGED_TABLE", "serde-lib": "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", "serde-name": "table7" }, "audit": { "creator": "anonymous", "createTime": "2024-09-06T08:41:12.419Z" }, "distribution": { "strategy": "none", "number": 0, "funcArgs": [] }, "sortOrders": [], "partitioning": [], "indexes": [] } }
{ "code": 0, "table": { "name": "table7", "comment": "", "columns": [ { "name": "structcomment", "type": { "type": "struct", "fields": [ { "name": "field", "type": "binary", "nullable": true } ] }, "comment": "", "nullable": true, "autoIncrement": false } ], "properties": { "input-format": "org.apache.hadoop.mapred.TextInputFormat", "transient_lastDdlTime": "1725612072", "output-format": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat", "location": "hdfs://hive:9000/user/hive/warehouse/sales.db/table7", "table-type": "MANAGED_TABLE", "serde-lib": "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", "serde-name": "table7" }, "audit": { "creator": "anonymous", "createTime": "2024-09-06T08:41:12.419Z" }, "distribution": { "strategy": "none", "number": 0, "funcArgs": [] }, "sortOrders": [], "partitioning": [], "indexes": [] } }
Missing the comment of the struct field [{"name":"field","type":"binary","nullable":true,"comment":"xxx1111"}]
[{"name":"field","type":"binary","nullable":true,"comment":"xxx1111"}]
N/A
No response
@mchades Would you help to have a check?
@LauraXia123 For source code I saw the field comment is not supported for hive struct column. Maybe this is the reason why comment of the struct field was missing.
Version
main branch
Describe what's wrong
get the response
{ "code": 0, "table": { "name": "table7", "comment": "", "columns": [ { "name": "structcomment", "type": { "type": "struct", "fields": [ { "name": "field", "type": "binary", "nullable": true } ] }, "comment": "", "nullable": true, "autoIncrement": false } ], "properties": { "input-format": "org.apache.hadoop.mapred.TextInputFormat", "transient_lastDdlTime": "1725612072", "output-format": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat", "location": "hdfs://hive:9000/user/hive/warehouse/sales.db/table7", "table-type": "MANAGED_TABLE", "serde-lib": "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe", "serde-name": "table7" }, "audit": { "creator": "anonymous", "createTime": "2024-09-06T08:41:12.419Z" }, "distribution": { "strategy": "none", "number": 0, "funcArgs": [] }, "sortOrders": [], "partitioning": [], "indexes": [] } }
Missing the comment of the struct field
[{"name":"field","type":"binary","nullable":true,"comment":"xxx1111"}]
Error message and/or stacktrace
N/A
How to reproduce
Additional context
No response