[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14307236#comment-14307236
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/359


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-05 Thread Timo Walther (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14307239#comment-14307239
 ] 

Timo Walther commented on FLINK-1471:
-

Fixed in d033fa8fa834d288ec977ef7bda043dfdc397e59.

 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14307180#comment-14307180
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user StephanEwen commented on the pull request:

https://github.com/apache/flink/pull/359#issuecomment-73042551
  
Skipping the validation on raw types makes total sense.


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14306869#comment-14306869
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user StephanEwen commented on the pull request:

https://github.com/apache/flink/pull/359#issuecomment-73013430
  
I do not quite get what this means now for the input validation.

Assume two classes, `A` and `B`, where `B` is a subclass of `A`.
```java
DataSetB data = ...;
data.map(new MapFunctionA, Long() {
   ...
});
```

I though that the validation previously checked that the MapFunction's 
input parameter is assignable from the data set type. So this is skipped now? 
It is not a big deal, I am just wondering why...


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14307049#comment-14307049
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user twalthr commented on the pull request:

https://github.com/apache/flink/pull/359#issuecomment-73028436
  
The discussion is how a Function without any generics (raw) should be 
treated. 

In general we have 3 possiblities:
- Skip input validation completely if Function implements 
ResultTypeQueryable
- Introduce a Interface /Anntotation SkipInputValidation for special use 
cases
- This PR: Skip input validation if Function is a raw type.


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305091#comment-14305091
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user rmetzger commented on the pull request:

https://github.com/apache/flink/pull/359#issuecomment-72859235
  
Thank you @twalthr!
I've verified your change and its fixing the issue I was reporting 
originally.

Except for one minor question, the change is good to merge.


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305120#comment-14305120
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user rmetzger commented on a diff in the pull request:

https://github.com/apache/flink/pull/359#discussion_r24085204
  
--- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java 
---
@@ -680,10 +680,20 @@ private static void validateInputType(Type t, 
TypeInformation? inType) {
}
}

-   private static void validateInputType(Class? baseClass, Class? 
clazz, int inputParamPos, TypeInformation? inType) {
+   private static void validateInputType(Class? baseClass, Class? 
clazz, int inputParamPos, TypeInformation? inTypeInfo) {
ArrayListType typeHierarchy = new ArrayListType();
+
+   // try to get generic parameter
+   Type inType;
+   try {
+   inType = getParameterType(baseClass, typeHierarchy, 
clazz, inputParamPos);
+   }
+   catch (Exception e) {
+   return; // skip input validation e.g. for raw types
--- End diff --

I know its annoying to change pull requests for these minor changes.
If you want you can change it and push it to `master`.


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305116#comment-14305116
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user twalthr commented on a diff in the pull request:

https://github.com/apache/flink/pull/359#discussion_r24085111
  
--- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java 
---
@@ -680,10 +680,20 @@ private static void validateInputType(Type t, 
TypeInformation? inType) {
}
}

-   private static void validateInputType(Class? baseClass, Class? 
clazz, int inputParamPos, TypeInformation? inType) {
+   private static void validateInputType(Class? baseClass, Class? 
clazz, int inputParamPos, TypeInformation? inTypeInfo) {
ArrayListType typeHierarchy = new ArrayListType();
+
+   // try to get generic parameter
+   Type inType;
+   try {
+   inType = getParameterType(baseClass, typeHierarchy, 
clazz, inputParamPos);
+   }
+   catch (Exception e) {
+   return; // skip input validation e.g. for raw types
--- End diff --

Actually yes, the input validation is only a nice to have feature and 
helps the normal user. If the getParameterType() does not work, the 
validation should be skipped. We can also change it to InvalidTypeException 
if you want.


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14303007#comment-14303007
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

Github user rmetzger commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72620298
  
I'll close it.
I've filed a jira for the issue and assigned it to @twalthr: 
https://issues.apache.org/jira/browse/FLINK-1471


 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther

 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-1471) Allow KeySelectors to implement ResultTypeQueryable

2015-02-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14304088#comment-14304088
 ] 

ASF GitHub Bot commented on FLINK-1471:
---

GitHub user twalthr opened a pull request:

https://github.com/apache/flink/pull/359

[FLINK-1471][java-api] Fixes wrong input validation if function has no 
generics

FLINK-1471 was not implemented properly. See also #354.

This PR skips the input validation if no generic parameters are available.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/twalthr/flink UnParameterizedFunctions

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/359.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #359


commit 7f70d7ef500cbb572a66f775d35609ac5903f767
Author: twalthr twal...@apache.org
Date:   2015-02-03T21:51:10Z

[FLINK-1471][java-api] Fixes wrong input validation if function has no 
generics




 Allow KeySelectors to implement ResultTypeQueryable
 ---

 Key: FLINK-1471
 URL: https://issues.apache.org/jira/browse/FLINK-1471
 Project: Flink
  Issue Type: Bug
  Components: Java API
Affects Versions: 0.9
Reporter: Robert Metzger
Assignee: Timo Walther
 Fix For: 0.9


 See https://github.com/apache/flink/pull/354



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)