Spark查询分区表
spark-sql -e
"SELECT
*
FROM
td_fixed_http_flow
WHERE
dt = '2018-12-02'
AND HOUR = '16' ;"
出现异常:
Caused by: java.io.FileNotFoundException: File hdfs://rzx121:8020/apps/hive/warehouse/td_fixed_http_flow/dt=2018-11-17/hour=17 does not exist.
at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.<init>(DistributedFileSystem.java:1081)
at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.<init>(DistributedFileSystem.java:1059)
at org.apache.hadoop.hdfs.DistributedFileSystem$23.doCall(DistributedFileSystem.java:1004)
at org.apache.hadoop.hdfs.DistributedFileSystem$23.doCall(DistributedFileSystem.java:1000)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hado

当尝试使用Spark SQL查询包含已删除HDFS分区的 Hive表时,出现 FileNotFoundException 异常。原因是Spark会根据`show partitions`检查所有分区,而Hive则不会。解决方案包括在Spark中设置`spark.sql.hive.verifyPartitionPath`为`true`来忽略损坏的分区,或者通过Hive的`alter table`命令删除损坏的分区。
最低0.47元/天 解锁文章
9881

被折叠的 条评论
为什么被折叠?



