What do I add to my SBT and include in my Scala class header to build a SnappyJob to use via snappy-job.sh submit?
I'm attempting to do some basic "Hello World" work in the form of a SnappyData job, before experimenting with building a job combined with other libraries based on Spark.
I'm stuck at the very beginning, attempting to build the shell of a program as described here:
https://snappydatainc.github.io/snappydata/programming_guide/snappydata_jobs/
I've input the following:
class snappytest implements SnappySQLJob {
/** SnappyData uses this as an entry point to execute SnappyData jobs. **/
def runSnappyJob(snappy: SnappySession, jobConfig: Config): Any = {}
/** SnappyData calls this function to validate the job input and reject invalid job requests **/
def isValidJob(snappy: SnappySession, config: Config): SnappyJobValidation = {}
}
Further down the page, it says "For writing jobs, users need to include snappydata-cluster_2.11:1.0.0 to their project dependencies." My SBT has:
name := "snappytest"
version := "0.1"
scalaVersion := "2.11.11"
libraryDependencies += "io.snappydata" % "snappy-spark-core_2.11" % "2.1.1.1"
libraryDependencies += "io.snappydata" % "snappy-spark-sql_2.11" % "2.1.1.1"
libraryDependencies += "io.snappydata" % "snappydata-cluster_2.11" % "1.0.0"
The header of my class file has:
import org.apache.spark.sql._
import org.apache.spark.sql.SnappySQLJob
IntelliJ IDEA is giving me the following errors in the IDE.
- Immediately after "snappytest", "'; ' or newline expected."
- Next word, "Cannot resolve symbol implements."
- Next word, "Cannot resolve symbol SnappySQLJob."
- In both def statements, "Cannot resolve symbol Config."
- If I Alt-Enter Config, I see many suggestions for what class to import, but none of them are Snappy or Spark-related.