Hi all,
I have a problem dropping a partition in an external table in Hive 1.2.1.

The table is an external table with location pointing to an HDFS snapshot.

Show create table mydb.my_table:

CREATE EXTERNAL TABLE `sax777h.te_ax_hd_inp_rap_por_on`(
...
)
PARTITIONED BY (
mydate date
)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
  'hdfs://myhdfsha/mypath/mydb/my_table/.snapshot/snapshot_1'

alter table mydb.my_table drop partition (dat_riferimento<>'1111-11-11');

If I execute the query above, I receive a permission denied exception due to 
user hive has no permission to access the 
/mypath/mydb/my_table/.snapshot/snapshot_1/mydate=$today, that is ok, because 
it is a snapshot dir. But my question is:

Since the table is external, why the query tries to delete data on the 
filesystem? Doesn't it should delete only metadata from the metastore?

If I create a new external table, pointing to another snapshot on HDFS, the 
drop partition query works.


Thank you!




DXC Technology Company -- This message is transmitted to you by or on behalf of 
DXC Technology Company or one of its affiliates. It is intended exclusively for 
the addressee. The substance of this message, along with any attachments, may 
contain proprietary, confidential or privileged information or information that 
is otherwise legally exempt from disclosure. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended recipient 
of this message, you are not authorized to read, print, retain, copy or 
disseminate any part of this message. If you have received this message in 
error, please destroy and delete all copies and notify the sender by return 
e-mail. Regardless of content, this e-mail shall not operate to bind DXC 
Technology Company or any of its affiliates to any order or other contract 
unless pursuant to explicit written agreement or government initiative 
expressly permitting the use of e-mail for such purpose.

Reply via email to