2017-05-31 65 views
0

我從蜂巢保存到本地文件系統的文本文件中使用下面的查詢導出數據:變化而產生的配置單元文件的權限

INSERT OVERWRITE LOCAL DIRECTORY '/local/file/system/directory' 
    ROW FORMAT DELIMITED 
    FIELDS TERMINATED BY ',' 
    NULL DEFINED AS '' 
    SELECT * FROM staging_table WHERE date='2017-05-28'; 

查詢產生預期的文件,但我有問題刪除該文件是因爲該權限。

-rw-rw-r-- 1 hive hive 12345 May 31 13:03 000000_0 

是否可以更改文件的權限或所有者?

回答

0

您需要須藤或root訪問這樣做:

sudo chown -R NewOwnerName:NewGroupName /local/file/system/directory 
0

如果你在萊納斯只是改變權限爲777,然後應該是可編輯的任何用戶

sudo chmod -R 777 directoryPath 

sudo chmod 777 filePath 

如果你是root用戶,你不需要sudo

如果您是在Windows中使用ICACLS

C:\>icacls "D:\test" /grant John:(OI)(CI)F /T 

據做MS文檔:

F = Full Control 
CI = Container Inherit - This flag indicates that subordinate containers will inherit this ACE. 
OI = Object Inherit - This flag indicates that subordinate files will inherit the ACE. 
/T = Apply recursively to existing files and sub-folders. (OI and CI only apply to new files and sub-folders). Credit: comment by @AlexSpence