Skip to content
Advertisement

Drop a hive table named “union”

I am trying to drop a table names “union” but I keep getting an error. I am not sure who and how created that table, but nothing works on it, including describe or select. Using “hdfs dfs -ls” outside of hive, I can see that table exists and there is data in it, but cannot drop the table. I am assuming there may be a problem because the table is called “union” and the error I get is

“cannot recognize input near ‘union'”.

How can I drop the table?

Advertisement

Answer

to escape in hive you can use bakctick:

DROP TABLE IF EXISTS `union`;
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement