Re: Implicit inference of TypeInformation for join keys

2016-03-31 Thread Timur Fayruzov
I'm very content with an extra `apply`, it's much cleaner than any of my initial solutions. On Thu, Mar 31, 2016 at 2:18 AM, Aljoscha Krettek wrote: > I'm afraid there is no way around having that extra ".apply" because the > Scala compiler will get confused with the additional implicit paramete

Re: Implicit inference of TypeInformation for join keys

2016-03-31 Thread Aljoscha Krettek
I'm afraid there is no way around having that extra ".apply" because the Scala compiler will get confused with the additional implicit parameter. It's a bit ugly, though ... On Wed, 30 Mar 2016 at 18:34 Timur Fayruzov wrote: > Actually, there is an even easier solution (which I saw in your reply

Re: Implicit inference of TypeInformation for join keys

2016-03-30 Thread Timur Fayruzov
Actually, there is an even easier solution (which I saw in your reply to my other question): ``` a.coGroup(b) .where(e => (e.f1, e.f2)) .equalTo(e => (e.f1, e.f2)).apply { (left, right) => 1 }.print() ``` pretty much does what I want. Explicit `apply` gives a hint that a compiler was miss

Re: Implicit inference of TypeInformation for join keys

2016-03-30 Thread Chiwan Park
Hi Timur, You have to use `createTypeInfomation` method in `org.apache.flink.api` package to create TypeInformation object for Scala-specific objects such as case classes, tuples, eithers, options. For example: ``` import org.apache.flink.api.scala._ // to import package object val a: DataSet[

Re: Implicit inference of TypeInformation for join keys

2016-03-30 Thread Timur Fayruzov
Thank you Chiwan! Yes, I understand that there are workarounds that don't use function argument (and thus do not require implicit arguments). I try to avoid positional and string-based keys because there is no compiler guarantees when you refactor or accidentally change the underlying case classes.

Re: Implicit inference of TypeInformation for join keys

2016-03-30 Thread Chiwan Park
Hi Timur, You can use a composite key [1] to compare keys consisting of multiple fields. For example: ``` val a = env.fromCollection(Seq(Thing("a", "b"), Thing("c", "d"))) val b = env.fromCollection(Seq(Thing("a", "x"), Thing("z", "m"))) a.coGroup(b) .where(“f1”, “f2”) // Flink compares the va

Implicit inference of TypeInformation for join keys

2016-03-29 Thread Timur Fayruzov
Hello, Another issue I have encountered is incorrect implicit resolution (I'm using Scala 2.11.7). Here's the example (with a workaround): val a = env.fromCollection(Seq(Thing("a", "b"), Thing("c", "d"))) val b = env.fromCollection(Seq(Thing("a", "x"), Thing("z", "m"))) a.coGroup(b) .where(e =>