gpt4 book ai didi

scala - 如何修复 sbt 项目中的 "origin location must be absolute"错误(使用 Spark 2.4.5 和 DeltaLake 0.6.1)?

转载 作者:行者123 更新时间:2023-12-04 09:37:12 26 4
gpt4 key购买 nike

我正在尝试使用 DeltaLake 0.6.1 为 Spark 2.4.5 设置 SBT 项目。我的构建文件如下。
但是似乎此配置无法解决某些依赖项。

[info] Reapplying settings...
[info] Set current project to red-basket-pipelnes (in build file:/Users/ashika.umagiliya/git-repo/redbasket-pipelines/red-basket-pipelnes/)
[info] Updating ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.antlr#antlr4;4.7: org.antlr#antlr4;4.7!antlr4.pom(pom.original) origin location must be absolute: file:/Users/ashika.umagiliya/.m2/repository/org/antlr/antlr4/4.7/antlr4-4.7.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.antlr:antlr4:4.7
[warn] +- io.delta:delta-core_2.11:0.6.1 (/Users/ashika.umagiliya/git-repo/redbasket-pipelines/red-basket-pipelnes/build.sbt#L13-26)
[warn] +- com.mycompany.dpd.solutions:deltalake-pipelnes_2.11:1.0
[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.antlr#antlr4;4.7: org.antlr#antlr4;4.7!antlr4.pom(pom.original) origin location must be absolute: file:/Users/ashika.umagiliya/.m2/repository/org/antlr/antlr4/4.7/antlr4-4.7.pom
[error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
生成.sbt
name := "deltalake-pipelnes"
version := "1.0"
organization := "com.mycompany.dpd.solutions"

// The compatible Scala version for Spark 2.4.1 is 2.11
scalaVersion := "2.11.12"

val sparkVersion = "2.4.5"
val scalatestVersion = "3.0.5"
val deltaLakeCore = "0.6.1"
val sparkTestingBaseVersion = s"${sparkVersion}_0.14.0"

libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.apache.spark" %% "spark-hive" % sparkVersion % "provided",
"org.apache.spark" %% "spark-avro" % sparkVersion % "provided",

"io.delta" %% "delta-core" % deltaLakeCore,

"org.scalatest" %% "scalatest" % scalatestVersion % "test",
"com.holdenkarau" %% "spark-testing-base" % sparkTestingBaseVersion % "test"
)

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)

assemblyMergeStrategy in assembly := {
case PathList("org", "apache", xs @ _*) => MergeStrategy.last
case PathList("changelog.txt") => MergeStrategy.last
case PathList(ps @ _*) if ps.last contains "spring" => MergeStrategy.last

case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}

resolvers ++= Seq(
"SPDB Maven Repository" at "https://artifactory.mycompany-it.com/spdb-mvn/",
Resolver.mavenLocal)

publishMavenStyle := true
publishTo := {
val repoBaseUrl = "https://artifactory.mycompany-it.com/"
if (isSnapshot.value)
Some("snapshots" at repoBaseUrl + "spdb-mvn-snapshot/")
else
Some("releases" at repoBaseUrl + "spdb-mvn-release/")
}
publishConfiguration := publishConfiguration.value.withOverwrite(true)
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

artifact in (Compile, assembly) := {
val art = (artifact in (Compile, assembly)).value
art.withClassifier(Some("assembly"))
}

addArtifact(artifact in (Compile, assembly), assembly)

parallelExecution in Test := false
有关如何解决此问题的任何提示?

最佳答案

我还没有设法弄清楚它何时以及为什么发生,但我早些时候确实遇到过类似的与分辨率相关的错误。
每当我遇到像您这样的问题时,我通常会删除受影响的目录(例如 /Users/ashika.umagiliya/.m2/repository/org/antlr )并重新开始。它通常有帮助。如果没有,我删除~./ivy2也重新开始。这是一种大锤,可以完成工作(又名 if all you have is a hammer, everything looks like a nail )。
我总是确保使用最新最好的 sbt。你似乎在使用 macOS 所以使用 sdk update早和经常。
我还建议使用最新和最好的库版本,更具体地说,Spark 应该是 2.4.7(在 2.4.x 行中),而 Delta Lake 应该是 0.8.0。

关于scala - 如何修复 sbt 项目中的 "origin location must be absolute"错误(使用 Spark 2.4.5 和 DeltaLake 0.6.1)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62517800/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com