twitter/scalding — pull request #1149 by ianoc (2015-01-01 02:33:36+00:00)
Title: WIP, for comment. Jdbc Macros

Still in real world testing though has unit tests here. Not for merging yet. Want to solidify on the API and migrate some/all of our internal usages of JDBC to it to verify it covers all cases properly.

to be contributed also is a sibling source+tap combo that uses the method outlined @ http://www.vertica.com/2012/07/05/teaching-the-elephant-new-tricks/ with vertica. Over jdbc its been 80x faster for people(the api, not my code), and also is inside one transaction. This portion is functional but I want to hammer on it a bit in the real world before trying to place in scalding.

Sample usage:

```
import com.twitter.scalding.macros._
import MacroImplicits._
import com.twitter.scalding.jdbc._
import com.twitter.scalding.jdbc.macros._
import com.twitter.scalding.macros._

val cc = ConnectionConfig(
ConnectUrl("jdbc:mysql://yourmysqlserver:3306/scaldingtestdb"),
UserName("your username"),
Password("yourpassword"),
Adapter("mysql"))

case class TypedSource1(
date_id: Int,
@size(64) user_name: String,
age: Int,
@size(22) gender: String = "male")

case class TypedSource1JdbcSource() extends TypedJDBCSource[TypedSource1(TableName("helloWorld"), cc)

TypedPipe.from(List(TypedSource1(1234, "asdf", 13))).save(TypedSource1JdbcSource())
```