maia
maia

Reputation: 4360

Hive - Adding comments to tables

When I try to add comments to my Hive table,

ALTER TABLE table1 SET TBLPROPERTIES ('comment' = new_comment);

I get the following error:

FAILED: ParseException line 1:64 mismatched input 'new_comment' expecting StringLiteral near '=' in specifying key/value property

Anyone know how to properly add a comment?

Upvotes: 6

Views: 12882

Answers (1)

Ike Walker
Ike Walker

Reputation: 65537

The comment needs to be a quoted string. For example, these should work:

ALTER TABLE table1 SET TBLPROPERTIES ('comment' = 'Hello World!');

ALTER TABLE table1 SET TBLPROPERTIES ('comment' = "Hello World!");

Upvotes: 11

Related Questions