Yes... If you do not explicitly specify location for a table, it will use the default database.
*What is the use of EXTERNAL table , why do you have two table flavours :* Hive tables can be created as EXTERNAL or INTERNAL. This is a choice that affects how data is loaded, controlled, and managed. Use EXTERNAL tables when: 1. The data is also used outside of Hive. For example, the data files are read and processed by an existing program that doesn't lock the files. 2. Data needs to remain in the underlying location even after a DROP TABLE. This can apply if you are pointing multiple schemas (tables or views) at a single data set or if you are iterating through various possible schemas. 3. You want to use a custom location such as ASV. 4. Hive should not own data and control settings, dirs, etc., you have another program or process that will do those things. 5. You are not creating table based on existing table (AS SELECT). Use INTERNAL tables when Use INTERNAL tables when: The data is temporary. You want Hive to completely manage the lifecycle of the table and data. Regards Sanjiv Singh Mob : +091 9990-447-339 On Fri, Mar 27, 2015 at 7:40 PM, Raunak Jhawar <raunak.jha...@gmail.com> wrote: > This is not a bug. If you do not explicitly specify location for a table, > it will use the default database. > > -- > Thanks, > Raunak Jhawar > m: 09820890034 > > > > > > > On Fri, Mar 27, 2015 at 5:04 PM, Parth Anand <parth.an...@pb.com> wrote: > >> Hi, >> >> I was trying to create External table in hive. >> >> >> I used “create external table ext_2 (id string,name string) row format >> delimited fields terminated by ',' stored as textfile” command. >> >> >> >> This command created a table with external property as I checked by using >> “describe formatted ext_1” command. >> >> >> >> But when I used “Load data inpath ‘file_path’ into table ext_1” command >> to load data in table, *File in that path is transferred to hive >> directory*. >> >> >> >> According to documentation of external table at the time of creation >> external table we have to mention location of its file. >> and that file is not relocated to hive directory but in this case it is >> not behaving same. I am able to create external table without giving file >> path at the time of creation and that file is also getting transferred to >> Hive Directory. >> >> >> >> Can you please explain the usage of external table?? Is this is a bug? >> >> >> >> >> >> Regards >> >> Parth Anand >> >> >> >> ------------------------------ >> >> >