I’m attempting to create a stream using JDBCInputFormat.  Objective is to 
convert each record into a tuple and then serialize for input into a Kafka 
topic.  Here’s what I have so far.

```
val env = StreamExecutionEnvironment.getExecutionEnvironment

val inputFormat = JDBCInputFormat.buildJDBCInputFormat()
      .setDrivername("org.postgresql.Driver")
      .setDBUrl("jdbc:postgresql:test")
      .setQuery("select name from persons")
      .finish()

val stream : DataStream[Tuple1[String]] = env.createInput(...)
```

I think this is essentially what I want to do.  It would be nice if I could 
return tuples of arbitrary length, but reading the code suggests I have to 
commit to a defined arity.  So I have some questions.

1. Is there a better way to read from a database (i.e., defining my own 
`InputFormat` using Slick)?
2. To get the above example working, what should I supply to `createInput`?


Prez Cannady  
p: 617 500 3378  
e: revp...@opencorrelate.org <mailto:revp...@opencorrelate.org>  
GH: https://github.com/opencorrelate <https://github.com/opencorrelate>  
LI: https://www.linkedin.com/in/revprez <https://www.linkedin.com/in/revprez>  









Reply via email to