hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gm yu <husty...@gmail.com>
Subject Hive failed with "No files matching path"
Date Fri, 15 Jul 2016 01:59:39 GMT
Hello

I have a question about Hive(2.0.0) and HDFS(2.7.2). I met many Hive
failure with "No files matching path". The script like:

hadoop fs -test -e $hdfspath
if [ $? -ne 0 ]; then
    echo "Directory not exists!"
    hadoop fs -mkdir $hdfspath
else
    echo "Directory exists!"
fi

hadoop distcp oss://${bucket}/${filename} ${hdfspath}
hdfsname = $hdfspath/$filename
hadoop fs -test -e $hdfsname
if [ $? -ne 0 ]; then
   echo "File not exists!"
else
    echo "File exists!"
fi

sql=" LOAD DATA INPATH '${hdfspath}' OVERWRITE INTO TABLE {output}
PARTITION (pt='${time}');"

echo $sql;
hive -e "$sql"

if [ $? -ne 0 ]; then
    echo "Hive unsuccessful!"
else
    echo "Hive successful!"
fi

The log is:

Directory not exists!
File exists!
Hive unsuccessful!
FAILED: SemanticException Line 2:19 Invalid path 'xxxx': No files matching
path 'xxxx'

But rerun this script, everything is OK.

Any idea what is this about?

Thanks & Regards

Mime
View raw message