hive> create table test.dummy as select * from oraclehadoop.dummy;
This acquires SHARED_READ on oraclehadoop.dummy table and SHARED_READ on test database.
The effect is that you can drop test.dummy from another session while the insert is still in progress.
This operation is a bit odd in that it combines a DDL operation which is not transactional with a DML operation which is.
If it were to fail in the middle, the target table would remain. This can't be fixed easily but we should get an X lock on test.dummy.
The workaround is to split this into 2 commands
1. create table
2. perform insert