insert overwrite
An insert overwrite statement deletes any existing files in the target table or partition before adding new files based off of the select statement used. Note that when there are structure changes to a table or to the DML used to load the table that sometimes the old files are not deleted. When loading to a table using dynamic partitioning only partitions defined by the select statement will be overwritten. Any preexisting partitions in the target will remain and will not be deleted.
insert into
An insert into statement appends new data into a target table based off of the select statement used.
When working with tables and databases in HIVE. Below points can be usefull.
use database;
commandSELECT current_database()
SHOW CREATE TABLE tablename
DESCRIBE tablename
to show extended details like location serde used and others DESCRIBE FORMATTED tablename
. DESCRIBE can also be abbrevated as DESC.Importing data directly from RDBMS to HIVE can solve lots of time. Also we can run a freeform query(a join or some simple query) and populate it in a table of our choice directly into Hive.
--hive-import tells Sqoop that the final destination is Hive and not HDFS.
--hive-table option helps in importing the data to the table in hive chosen by us, otherwise it will be named as the source table being imported from RDBMS.