Created
August 7, 2015 18:30
-
-
Save shyamsalimkumar/a82bc4104dcbde8a275a to your computer and use it in GitHub Desktop.
Case class and implicit mapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.acme.spark.trial.dto | |
import com.datastax.spark.connector.mapper.DefaultColumnMapper | |
/** | |
* Class to represent a User | |
*/ | |
case class User(userId: Int, firstName: String, lastName: String) | |
object User { | |
implicit object Mapper extends DefaultColumnMapper[User](Map("userId" -> "user_id", | |
"firstName" -> "first_name", "lastName" -> "last_name")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment