Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why hive doesn't allow create external table with CTAS?

Tags:

hadoop

hive

In hive, create external table by CTAS is a semantic error, why? The table created by CTAS is atomic, while external table means data will not be deleted when dropping table, they do not seem to conflict.

like image 360
Liu Cheng Avatar asked Nov 03 '14 09:11

Liu Cheng


1 Answers

In Hive when we create a table(NOT external) the data will be stored in /user/hive/warehouse. But during External hive table creation the file will be anywhere else, we are just pointing to that hdfs directory and exposing the data as hive table to run hive queries etc. This SO answer more precisely Create hive table using "as select" or "like" and also specify delimiter

like image 128
scalauser Avatar answered Oct 09 '22 23:10

scalauser