[ 
https://issues.apache.org/jira/browse/HIVE-13662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315768#comment-15315768
 ] 

Pengcheng Xiong edited comment on HIVE-13662 at 6/5/16 6:27 AM:
----------------------------------------------------------------

Hi [~ashutoshc], after some investigation, I still have some questions on this. 
Please correct me if I am wrong. (1) FileSinkOperator will call 
"HiveFileFormatUtils.getHiveRecordWriter() which calls 
HiveOutputFormat::getHiveRecordWriter() which will eventually call 
FileSystem.create() which accepts permissions as an argument." This is true, 
but it is for 
SOMEPATH/warehouse/t2/.hive-staging_hive_2016-06-04_12-08-56_977_8632631213427778083-1/_task_tmp.-ext-10000/p1=5/_tmp.000000_0,
 for example. This file includes the taskID, i.e., _tmp.000000_0. (2) However, 
in Hive.java, when we move file, we do not care about the permission of 
_tmp.000000_0, we care about the permission of /p1=5. If /p1=5 is there, we 
need to use its existing permission (i.e., partition permission), otherwise we 
need to inherit from its parent (i.e., table permission). Thus, if we would 
like to set file permission and ACL in file sink operator (the goal of this 
jira), we need to create the directory /p1=5 with a correct permission, rather 
than to call FileSystem.create() with permissions.


was (Author: pxiong):
Hi [~ashutoshc], after some investigation, I still have some questions on this. 
Please correct me if I am wrong. (1) FileSinkOperator will call 
"HiveFileFormatUtils.getHiveRecordWriter() which calls 
HiveOutputFormat::getHiveRecordWriter() which will eventually call 
FileSystem.create() which accepts permissions as an argument." This is true, 
but it is for 
SOMEPATH/warehouse/t2/.hive-staging_hive_2016-06-04_12-08-56_977_8632631213427778083-1/_task_tmp.-ext-10000/p1=5/_tmp.000000_0,
 for example. This file includes the taskID, i.e., _tmp.000000_0. (2) However, 
in Hive.java, when we move file, we do not care about the permission of 
_tmp.000000_0, we care about the permission of /p1=5. If /p1=5 is there, we 
need to use its existing permission, otherwise we need to inherit from its 
parents. Thus, if we would like to set file permission and ACL in file sink 
operator (the goal of this jira), we need to create the directory /p1=5 with a 
correct permission, rather than to call FileSystem.create() with permissions.

> Set file permission and ACL in file sink operator
> -------------------------------------------------
>
>                 Key: HIVE-13662
>                 URL: https://issues.apache.org/jira/browse/HIVE-13662
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Rui Li
>            Assignee: Pengcheng Xiong
>         Attachments: HIVE-13662.01.patch
>
>
> As suggested 
> [here|https://issues.apache.org/jira/browse/HIVE-13572?focusedCommentId=15254438&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15254438].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to