Search code examples
apache-sparksbtapache-spark-mllib

I'm getting this error "object ml is not a member of package org.apache.spark"


I am using spark 2.4.4 My sbt file looks like

name := "convertor"

version := "0.1"

scalaVersion := "2.11.12"


libraryDependencies += "org.apache.spark" %% "spark-core" % "2.4.4"
libraryDependencies += "org.apache.spark" %% "spark-sql" % "2.4.4"
libraryDependencies += "org.apache.spark" %% "spark-mllib" % "2.4.4" % "runtime"

But still, I'm getting

Error:(6, 25) object ml is not a member of package org.apache.spark
import org.apache.spark.ml.feature.OneHotEncoderEstimator

Solution

  • I tried this library in my sbt file and my problem was solved.

    libraryDependencies += "org.apache.spark" %% "spark-mllib" % "2.3.0"