[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-04 Thread aalexandrov
Github user aalexandrov commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72857627
  
I think that this only happens for the primitive types. I think this is by 
design.

If you want to inspect generic parameters, Scala forces you to use the 
Scala reflection API. There is no way around that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread aalexandrov
Github user aalexandrov commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72660318
  
I would advocate to adding this one as well as a fallback option.

I have a situation where I want to use KeySelector that might return Java 
TupleXX instances parameterized with Scala types, e.g.:

```
class SelectFoo extends KeySelector[Tuple3[Int, Int, String], Tuple3[Int, 
String]] {
override def getKey(v: Tuple3[Int, Int, Int]) = new Tuple2(v.f0, v.f2)
}
``

Even though in this cases  the generic parameters are available, the Scala 
types cannot be inferred because the actual type field type parameters are 
erased by Scala and  are seen only as java.lang.Object from the Java reflection 
API.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread aalexandrov
Github user aalexandrov commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72660810
  
I think that [this StackOverflow article explains my 
problem](http://stackoverflow.com/questions/11586944/how-to-obtain-the-raw-datatype-of-a-parameter-of-a-field-that-is-specialized-in).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread StephanEwen
Github user StephanEwen commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72614564
  
So, this pull request can be closed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread aljoscha
Github user aljoscha commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72752435
  
Nope, sorry, also have no Idea why this is happening.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread rmetzger
Github user rmetzger closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-02-03 Thread rmetzger
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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-01-31 Thread twalthr
Github user twalthr commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72314389
  
getUnaryOperatorReturnType() does already call ResultTypeQueryable if 
available.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-01-31 Thread rmetzger
Github user rmetzger commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72314532
  
Without the change, I'm getting the following error, even though my 
KeyExtractor implements ResultTypeQueryable:
```java
Exception in thread main java.lang.IllegalArgumentException: The types of 
the interface org.apache.flink.api.java.functions.KeySelector could not be 
inferred. Support for synthetic interfaces, lambdas, and generic types is 
limited at this point.
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getParameterType(TypeExtractor.java:640)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getParameterTypeFromGenericType(TypeExtractor.java:664)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getParameterType(TypeExtractor.java:627)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.validateInputType(TypeExtractor.java:686)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getUnaryOperatorReturnType(TypeExtractor.java:235)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getKeySelectorTypes(TypeExtractor.java:189)
at 
org.apache.flink.api.java.typeutils.TypeExtractor.getKeySelectorTypes(TypeExtractor.java:183)
at 
org.apache.flink.api.java.operators.JoinOperator$JoinOperatorSets.where(JoinOperator.java:871)
at 
flink.generators.programs.TPCHGeneratorExample.main(TPCHGeneratorExample.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-01-31 Thread rmetzger
Github user rmetzger commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72315355
  
Do you want to fix it or should I do it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request: Allow KeySelectors to implement ResultTypeQuer...

2015-01-31 Thread rmetzger
Github user rmetzger commented on the pull request:

https://github.com/apache/flink/pull/354#issuecomment-72316077
  
Cool, thank you


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---