当前位置: 首页 > news >正文

spark Structured报错解决

报错,不想看原因的直接去解决方案试试

Exception in thread "main" java.lang.IllegalArgumentException: Pathname /C:/Users/Administrator/AppData/Local/Temp/1/temporary-611514af-8dc5-4b20-9237-e5f2d21fdf88/metadata from hdfs://master:8020/C:/Users/Administrator/AppData/Local/Temp/1/temporary-611514af-8dc5-4b20-9237-e5f2d21fdf88/metadata is not a valid DFS filename.at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:197)at org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:106)at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1305)at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1301)at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1317)at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1426)at org.apache.spark.sql.execution.streaming.StreamMetadata$.read(StreamMetadata.scala:51)at org.apache.spark.sql.execution.streaming.StreamExecution.<init>(StreamExecution.scala:122)at org.apache.spark.sql.execution.streaming.MicroBatchExecution.<init>(MicroBatchExecution.scala:49)at org.apache.spark.sql.streaming.StreamingQueryManager.createQuery(StreamingQueryManager.scala:258)at org.apache.spark.sql.streaming.StreamingQueryManager.startQuery(StreamingQueryManager.scala:299)at org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:296)at com.gugu.book.basespark.chapter08.StructuredNetworkWordCount$.main(StructuredNetworkWordCount.scala:25)at com.gugu.book.basespark.chapter08.StructuredNetworkWordCount.main(StructuredNetworkWordCount.scala)
看报错信息好像是要赋权,路径不存在,但是这个路径有点古怪

hdfs://master:8020/C:/Users/Administrator/AppData/Local/Temp/1/temporary-611514af-8dc5-4b20-9237-e5f2d21fdf88/metadata is not a valid DFS filename

按道理不应该出现C:/。。。。这个是我本地的一个地址,但是却拼接到了hdfs文件系统下,应该是什么配置的有问题
顺着报错信息

在这里插入图片描述
只需要checkpointRoot修改就行这个地址来源于checkpointLocation
org.apache.spark.sql.streaming.StreamingQueryManager#createQuery
在这里插入图片描述

也就是说直接改变“checkpointLocation”的值就行

解决方案

在start之前设置

            .option("checkpointLocation", "file:///D:\\applicationfiles\\data\\kafka")

在这里插入图片描述
解决,完美
环境问题,在windows下有些默认配置会失效

http://www.lryc.cn/news/172936.html

相关文章:

  • Matter 协议系列:发现
  • Oracle 12c Docker镜像配置SSL
  • 版本控制系统git:一文了解git,以及它在生活中的应用,网站维护git代码,图导,自动化部署代码
  • uqrcode+uni-app 微信小程序生成二维码
  • 从零开始的 MyBatis 拦截器之旅:实战经验分享
  • 网络编程day05(IO多路复用)
  • 人声分离网站,帮你快速提取视频中的人声和背景音乐
  • 计算机网络常见问题
  • 上PICO,沉浸式观看亚运直播,参与跨国界游戏竞技
  • 无重复字符的最长子串 - 力扣(LeetCode)
  • 企业行政许可的种类有哪些?
  • Flink--4、DateStream API(执行环境、源算子、基本转换算子)
  • #循循渐进学51单片机#指针基础与1602液晶的初步认识#not.11
  • Lua学习笔记:探究package
  • 【面试经典150 | 双指针】三数之和
  • 现代卷积网络实战系列3:PyTorch从零构建AlexNet训练MNIST数据集
  • Django系列:Django应用(app)的创建与配置
  • Linux查看程序和动态库依赖的动态库
  • vue3 无法使用pnpm安装依赖 或 Cannot find module preinstall.js
  • C/C++连接数据库,包含完整代码。
  • AUTOSAR词典:CAN驱动Mailbox配置技术要点全解析
  • C语言 coding style
  • Python办公自动化之PDF
  • 【每日一题Day331】LC2560打家劫舍 IV | 二分查找 + 贪心
  • JVM 参数详解
  • uni-app获取地理位置
  • Learn Prompt-Prompt 高级技巧:思维链 Chain of Thought Prompting
  • Vim编辑器使用入门
  • 早餐与风景
  • 常用python代码串