MySqlRead.scala - Compilation error


I have configured the Scala IDE on Ubuntu VM. While compiling the MySqlRead (refer to the SQL program list in Session 7 Notes, shared by Prahanth) program, the following compilation error is displayed:

At this line: 'val option = Map("url" => "jdbc:mysql://localhost:3306/ecommerce", "dbtable" => "sales","user"=>"root","password"=>"abc123")"
Error: " not a legal formal parameter. Note: Tuples cannot be directly destructured in method or function parameters. Either create a single parameter accepting the Tuple1, or consider a pattern matching anonymous function: `{ case (param1, param1) => ... }
I would greatly appreciate if you would provide a resolution to this issue, at the earliest.
Regards, Sri


1 Answer(s)


I believe you are working with Spark 2x then try this:

            val properties = new Properties()