前提:
上傳資料至hdfs 的/user/root/下,建立了hive的orc表,準備load資料,建立了臨時的ordertmp的textfile格式表,後面用insert overwrite進目標表。
執行load data 從/user/root/下載入資料到hive表中,報下面的許可權錯誤。
0: jdbc:hive2://node01:10000> load data inpath '/user/root/order/order.txt' into table ordertmp;
info : compiling command(queryid=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36): load data inpath '/user/root/order/order.txt' into table ordertmp
info : semantic analysis completed
info : returning hive schema: schema(fieldschemas:null, properties:null)
info : completed compiling command(queryid=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36)
; time taken: 0.471 seconds
info : executing command(queryid=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36): load data inpath '/user/root/order/order.txt' into table ordertmp
info : starting task [stage-0:move]
in serial mode
info : loading data to table default.ordertmp from hdfs://node01:8020/user/root/order/order.txt
error : failed: execution error, return code 1 from org.apache.hadoop.hive.ql.exec.movetask. org.apache.hadoop.hive.ql.metadata.hiveexception: access denied: unable to move source hdfs://node01:8020/user/root/order/order.txt to destination hdfs://node01:8020/user/hive/warehouse/ordertmp: permission denied: user=anonymous, access=write, inode=
"/user/root/order":root:supergroup:drwxr-xr-x
info : completed executing command(queryid=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36)
; time taken: 0.289 seconds
error: error while processing statement: failed: execution error, return code 1 from org.apache.hadoop.hive.ql.exec.movetask. org.apache.hadoop.hive.ql.metadata.hiveexception: access denied: unable to move source hdfs://node01:8020/user/root/order/order.txt to destination hdfs://node01:8020/user/hive/warehouse/ordertmp: permission denied: user=anonymous, access=write, inode=
"/user/root/order":root:supergroup:drwxr-xr-x (state=08s01,code=1)
解決:
su hdfs
hdfs dfs -chmod -r 777 /user/root/
解決。 HIVE 載入本地資料檔案報錯
問題出現背景 從本地資料檔案載入資料表 資料檔案 qqq,aaa ccc,rrrr 建表語句 create external table dwh tag convert dict obj string,tag string partitioned by p type string row forma...
hive資料載入
一.需要注意的問題 1.hive不支援行級別的增刪改 2.使用overwrite會覆蓋表的原有資料,into則是追加。3.local會將本地檔案系統複製乙份再上傳至指定目錄,無local只是將本地檔案系統上的資料移動到指定目錄。4.若目錄指向hdfs上的資料則執行的是move操作。5.分隔符要與資料...
hive表載入資料
總結自己在hive表中常用的幾種載入資料的方式 1.load data 常用 load data inpath 集群路徑.txt load data local inpath 本地路徑 2.select 偶爾用 insert into table tablename1 select from tab...