You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Thomas FOURNIER <th...@gmail.com> on 2016/11/08 21:58:44 UTC

Left outer join

Hello, I'm facing an issue with leftOuterJoin:

- input is a DataSet[String]
- metrics is a DataSet[(String,Long)]

I'm doing a leftOuterJoin like this:

input
.leftOuterJoin(metrics)
.where(0)
.equalTo(0) {
     (left,right)  =>     ...
}


But I encounter the following error:
Specifying keys via field positions is only valid for tuple data types.
Type: String

What is the correct way to handle this case (where left member has only one
field ?)

Thanks
Regards

Thomas

Re: Left outer join

Posted by Fabian Hueske <fh...@gmail.com>.
This should work as well:

input
.leftOuterJoin(metrics)
.where("*")
.equalTo(0) {
     (left,right)  =>     ...
}

2016-11-08 23:10 GMT+01:00 Till Rohrmann <tr...@apache.org>:

> Hi Thomas,
>
> either you map your input data set into a tuple input.map(x => Tuple1(x))
> or you specify a key selector leftOuterJoin(metrics).where(x =>
> x).equalTo(0).
>
> I think the user ML user@flink.apache.org would be a better place to ask
> Flink usage related questions. The dev ML is mainly used for technical
> discussions.
>
> Cheers,
> Till
> ​
>
> On Tue, Nov 8, 2016 at 10:58 PM, Thomas FOURNIER <
> thomasfournier314@gmail.com> wrote:
>
> > Hello, I'm facing an issue with leftOuterJoin:
> >
> > - input is a DataSet[String]
> > - metrics is a DataSet[(String,Long)]
> >
> > I'm doing a leftOuterJoin like this:
> >
> > input
> > .leftOuterJoin(metrics)
> > .where(0)
> > .equalTo(0) {
> >      (left,right)  =>     ...
> > }
> >
> >
> > But I encounter the following error:
> > Specifying keys via field positions is only valid for tuple data types.
> > Type: String
> >
> > What is the correct way to handle this case (where left member has only
> one
> > field ?)
> >
> > Thanks
> > Regards
> >
> > Thomas
> >
>

Re: Left outer join

Posted by Till Rohrmann <tr...@apache.org>.
Hi Thomas,

either you map your input data set into a tuple input.map(x => Tuple1(x))
or you specify a key selector leftOuterJoin(metrics).where(x =>
x).equalTo(0).

I think the user ML user@flink.apache.org would be a better place to ask
Flink usage related questions. The dev ML is mainly used for technical
discussions.

Cheers,
Till
​

On Tue, Nov 8, 2016 at 10:58 PM, Thomas FOURNIER <
thomasfournier314@gmail.com> wrote:

> Hello, I'm facing an issue with leftOuterJoin:
>
> - input is a DataSet[String]
> - metrics is a DataSet[(String,Long)]
>
> I'm doing a leftOuterJoin like this:
>
> input
> .leftOuterJoin(metrics)
> .where(0)
> .equalTo(0) {
>      (left,right)  =>     ...
> }
>
>
> But I encounter the following error:
> Specifying keys via field positions is only valid for tuple data types.
> Type: String
>
> What is the correct way to handle this case (where left member has only one
> field ?)
>
> Thanks
> Regards
>
> Thomas
>