Support Questions

Find answers, ask questions, and share your expertise

Comments not available for Hive struct type.

avatar
New Contributor

A comment may be specified for the structure type for the URL link.

 

CREATE EXTERNAL TABLE IF NOT EXISTS test_db.test_table
(
`id` string comment 'id',
`name` string comment 'name',
`area` struct<`country`: string comment 'test country, `address`:string comment 'test address> comment 'test struct'
);

 

The 'test country' and 'test address' comment of the area struct does not apply.

The 'test structure' comment has been properly applied.

What's the reason?

 

 

The same article was posted on the Apache Hive issue.

https://issues.apache.org/jira/browse/HIVE-26593

 

 

1 REPLY 1

avatar
Super Collaborator

Hello @sseoju ,

You may get the required information in Impala as shown below:

[node1:21000] default> CREATE EXTERNAL TABLE IF NOT EXISTS test_table
> (
> `id` string comment 'id',
> `name` string comment 'name',
> `area` struct<`country`: string comment "test country", `address`:string comment 'test address'> comment 'test struct'
> );
Query: CREATE EXTERNAL TABLE IF NOT EXISTS test_table
(
`id` string comment 'id',
`name` string comment 'name',
`area` struct<`country`: string comment "test country", `address`:string comment 'test address'> comment 'test struct'
)
+-------------------------+
| summary |
+-------------------------+
| Table has been created. |
+-------------------------+
Fetched 1 row(s) in 0.26s
[node1:21000] default> desc test_table;
Query: describe test_table
+------+------------------------------------------+-------------+
| name | type | comment |
+------+------------------------------------------+-------------+
| id | string | id |
| name | string | name |
| area | struct< | test struct |
| | country:string comment 'test country', | |
| | address:string comment 'test address' | |
| | > | |
+------+------------------------------------------+-------------+
Fetched 3 row(s) in 0.28s

This is also mentioned here https://impala.apache.org/docs/build/html/topics/impala_describe.html

Let me know if this helps.

Cheers!