flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject git commit: Remove naive verification of tuple size
Date Wed, 17 Sep 2014 15:23:20 GMT
Repository: incubator-flink
Updated Branches:
  refs/heads/master 244c53903 -> 2f6a9559c


Remove naive verification of tuple size

This verification will not work.
Think of spaces or escaped ?
I think it's easier for users to parse the SQLException

Author: Moritz Schubotz <github@ckurs.de>

Closes #116 from physikerwelt/patch-1 and squashes the following commits:

69a3d2a [Moritz Schubotz] Remove associated test as well
b51b4f0 [Moritz Schubotz] Remove naive verification of tuple size


Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/2f6a9559
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/2f6a9559
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/2f6a9559

Branch: refs/heads/master
Commit: 2f6a9559cf475e72f15fb0845bb2d471cfe38c92
Parents: 244c539
Author: Moritz Schubotz <github@ckurs.de>
Authored: Wed Sep 17 17:22:26 2014 +0200
Committer: Robert Metzger <rmetzger@apache.org>
Committed: Wed Sep 17 17:22:26 2014 +0200

----------------------------------------------------------------------
 .../flink/api/java/io/jdbc/JDBCOutputFormat.java   |  4 ----
 .../api/java/io/jdbc/JDBCOutputFormatTest.java     | 17 -----------------
 2 files changed, 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/2f6a9559/flink-addons/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
----------------------------------------------------------------------
diff --git a/flink-addons/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
b/flink-addons/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
index 9e08206..dc6b315 100644
--- a/flink-addons/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
+++ b/flink-addons/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
@@ -117,10 +117,6 @@ public class JDBCOutputFormat<OUT extends Tuple> implements OutputFormat<OUT>
{
 	@Override
 	public void writeRecord(OUT tuple) throws IOException {
 		try {
-			if (query.split("\\?,").length != tuple.getArity()) {
-				close();
-				throw new IOException("Tuple size does not match columncount");
-			}
 			if (types == null) {
 				extractTypes(tuple);
 			}

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/2f6a9559/flink-addons/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/flink-addons/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormatTest.java
b/flink-addons/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormatTest.java
index 904c6d8..6e3e7e1 100644
--- a/flink-addons/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormatTest.java
+++ b/flink-addons/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormatTest.java
@@ -161,23 +161,6 @@ public class JDBCOutputFormatTest {
 				.finish();
 	}
 
-	@Test(expected = IOException.class)
-	public void testIncompatibleTuple() throws IOException {
-		jdbcOutputFormat = JDBCOutputFormat.buildJDBCOutputFormat()
-				.setDrivername("org.apache.derby.jdbc.EmbeddedDriver")
-				.setDBUrl("jdbc:derby:memory:ebookshop")
-				.setQuery("insert into books (id, title, author, price, qty) values (?,?,?,?,?)")
-				.finish();
-		jdbcOutputFormat.open(0, 1);
-
-		Tuple3 tuple3 = new Tuple3();
-		tuple3.setField(4, 0);
-		tuple3.setField("hi", 1);
-		tuple3.setField(4.4, 2);
-
-		jdbcOutputFormat.writeRecord(tuple3);
-		jdbcOutputFormat.close();
-	}
 
 	@Test(expected = IllegalArgumentException.class)
 	public void testIncompatibleTypes() throws IOException {


Mime
View raw message