You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2014/06/18 20:52:28 UTC
[2/6] git commit: Projection constructor adjusts to max tuple size
Projection constructor adjusts to max tuple size
This closes #27
Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/6ee874aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/6ee874aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/6ee874aa
Branch: refs/heads/master
Commit: 6ee874aa05e0eeda133bcc6100cb2330e1d27154
Parents: 5c23b8f
Author: zentol <s....@web.de>
Authored: Wed Jun 18 14:06:12 2014 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Wed Jun 18 18:51:01 2014 +0200
----------------------------------------------------------------------
.../eu/stratosphere/api/java/operators/ProjectOperator.java | 5 +++--
.../stratosphere/api/java/operator/ProjectionOperatorTest.java | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/6ee874aa/stratosphere-java/src/main/java/eu/stratosphere/api/java/operators/ProjectOperator.java
----------------------------------------------------------------------
diff --git a/stratosphere-java/src/main/java/eu/stratosphere/api/java/operators/ProjectOperator.java b/stratosphere-java/src/main/java/eu/stratosphere/api/java/operators/ProjectOperator.java
index 31583e9..1907393 100644
--- a/stratosphere-java/src/main/java/eu/stratosphere/api/java/operators/ProjectOperator.java
+++ b/stratosphere-java/src/main/java/eu/stratosphere/api/java/operators/ProjectOperator.java
@@ -72,8 +72,9 @@ public class ProjectOperator<IN, OUT extends Tuple>
if(fieldIndexes.length == 0) {
throw new IllegalArgumentException("project() needs to select at least one (1) field.");
- } else if(fieldIndexes.length > 22) {
- throw new IllegalArgumentException("project() may select only up to twenty-two (22) fields.");
+ } else if(fieldIndexes.length > Tuple.MAX_ARITY - 1) {
+ throw new IllegalArgumentException(
+ "project() may select only up to (" + (Tuple.MAX_ARITY - 1) + ") fields.");
}
int maxFieldIndex = ((TupleTypeInfo<?>)ds.getType()).getArity();
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/6ee874aa/stratosphere-java/src/test/java/eu/stratosphere/api/java/operator/ProjectionOperatorTest.java
----------------------------------------------------------------------
diff --git a/stratosphere-java/src/test/java/eu/stratosphere/api/java/operator/ProjectionOperatorTest.java b/stratosphere-java/src/test/java/eu/stratosphere/api/java/operator/ProjectionOperatorTest.java
index a5ac562..ac496c2 100644
--- a/stratosphere-java/src/test/java/eu/stratosphere/api/java/operator/ProjectionOperatorTest.java
+++ b/stratosphere-java/src/test/java/eu/stratosphere/api/java/operator/ProjectionOperatorTest.java
@@ -62,7 +62,7 @@ public class ProjectionOperatorTest {
// should not work: too many fields
try {
- tupleDs.project(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22);
+ tupleDs.project(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
Assert.fail();
} catch(IllegalArgumentException iae) {
// we're good here