I have seen other posts saying that double hyphen -- should be a hive comment. But at least within the hive CLI that is not working properly;
hive> -- some comment;
FAILED: Parse Error: line 0:-1 cannot recognize input near '<EOF>' '<EOF>' '<EOF>'
Even in Eduardo Capriolo's book he says the same:
As of Hive v0.8.0, you can embed lines of comments that start with the string --,
for example:
-- Copyright (c) 2012 Megacorp, LLC.
-- This is the best Hive script evar!
The version is apparently 0.8.1 (I am using latest Amazon EMR)
hadoop@ip-10-114-113-44:~$ hive
bin is /home/hadoop/.versions/hive-0.8.1/bin
Just use -- two dashes to make a comment in hive.
No, Multi-line comments are not supported in Hive.
CREATE TABLE orders ( order_id INT COMMENT 'Unique order id', order_date STRING COMMENT 'Date on which order is placed', order_customer_id INT COMMENT 'Customer id who placed the order', order_status STRING COMMENT 'Current status of the order' ) COMMENT 'Table to save order level details';
Case is simple Hive accepts comments but not as a single line. If you try:
--comment
show tables;
or
show tables
--comment;
everything will be fine. GL with Hive struggle!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With