Skip to content

Commit

Permalink
[hotfix] Update DataSet docs concerning JDBCInputFormat.
Browse files Browse the repository at this point in the history
The way to provide type information was outdated.
  • Loading branch information
mbode authored and zentol committed Jun 2, 2017
1 parent 5605107 commit 94ade3d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/dev/batch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,14 +890,12 @@ DataSet<Long> numbers = env.generateSequence(1, 10000000);
// Read data from a relational database using the JDBC input format
DataSet<Tuple2<String, Integer> dbData =
env.createInput(
// create and configure input format
JDBCInputFormat.buildJDBCInputFormat()
.setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
.setDBUrl("jdbc:derby:memory:persons")
.setQuery("select name, age from persons")
.finish(),
// specify type information for DataSet
new TupleTypeInfo(Tuple2.class, STRING_TYPE_INFO, INT_TYPE_INFO)
.setRowTypeInfo(new RowTypeInfo(BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO))
.finish()
);

// Note: Flink's program compiler needs to infer the data types of the data items which are returned
Expand Down

0 comments on commit 94ade3d

Please sign in to comment.