在 Win10 中,在 IntelliJ 中,此路径(“C:/hive/Orders_[0-9]*.csv”)作为独立的 java Spark 作业运行时效果很好。但不作为 Spring Boot Spark 工作。似乎 Spring Boot 未检测到本机文件系统。不知道如何解决这个问题。
Dataset<Row> DF1 = spark
.read().format("csv")
.option("header", "true")
.option("delimiter", "\t")
.load("C:/hive/Orders_[0-9]*.csv");
错误:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-09-04 21:59:27.701 ERROR [omni-ods-migration,,,] 8216 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'odsMigrationService': Invocation of init method failed; nested exception is java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:137)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
当给出确切的文件名的路径时,下面的代码在 Spring Boot 中也能正常工作。
Dataset<Row> DF1 = spark
.read().format("csv")
.option("header", "true")
.option("delimiter", "\t")
.load("C:/hive/Orders_000001.csv");
如何解决这个问题?
收到一只叮咚
相关分类