[FLINK-1040] Make type() call in projections optional

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[FLINK-1040] Make type() call in projections optional

Chen Xu
Hi Stephan,

I am working on the issue [FLINK-1040].

At first, I would like to remove type() call in projections totally.

However, considering the case in JoinProjection and CrossProjection,
"chaining projection" like

ds1.join(ds2).where(0).equalTo(0)
.projectSecond(2)
.projectFirst(1)
                .types(String.class);

usually happens.

Of course, String.class would be extracted by compiler.

However, as the final transformation are activated by types(), it seems we
can turn the sharp to be

ds1.join(ds2).where(0).equalTo(0)
.projectSecond(2)
.projectFirst(1)
                .types();

or rename types() here like doJoinProject()..

Does it make sense or anything wrong here?

Cheers!
-Chen
​ Xu​
Reply | Threaded
Open this post in threaded view
|

Re: [FLINK-1040] Make type() call in projections optional

Fabian Hueske
Hi Chen,

sounds good to me.

Cheers, Fabian

2014-11-04 10:00 GMT+01:00 Chen Xu <[hidden email]>:

> Hi Stephan,
>
> I am working on the issue [FLINK-1040].
>
> At first, I would like to remove type() call in projections totally.
>
> However, considering the case in JoinProjection and CrossProjection,
> "chaining projection" like
>
> ds1.join(ds2).where(0).equalTo(0)
> .projectSecond(2)
> .projectFirst(1)
>                 .types(String.class);
>
> usually happens.
>
> Of course, String.class would be extracted by compiler.
>
> However, as the final transformation are activated by types(), it seems we
> can turn the sharp to be
>
> ds1.join(ds2).where(0).equalTo(0)
> .projectSecond(2)
> .projectFirst(1)
>                 .types();
>
> or rename types() here like doJoinProject()..
>
> Does it make sense or anything wrong here?
>
> Cheers!
> -Chen
> ​ Xu​
>
Reply | Threaded
Open this post in threaded view
|

Re: [FLINK-1040] Make type() call in projections optional

Stephan Ewen
In reply to this post by Chen Xu
I think you can get around the final call to "types()" or "doJoin()" when
every of those "projectX()" calls creates a ready "projectJoinOperator"
that inherits from DataSet. Further calls only append more fields.

Stephan

Am 04.11.2014 10:02 schrieb "Chen Xu" <[hidden email]>:
>
>> Hi Stephan,
>>
>> I am working on the issue [FLINK-1040].
>>
>> At first, I would like to remove type() call in projections totally.
>>
>> However, considering the case in JoinProjection and CrossProjection,
"chaining projection" like

>>
>> ds1.join(ds2).where(0).equalTo(0)
>> .projectSecond(2)
>> .projectFirst(1)
>>                 .types(String.class);
>>
>> usually happens.
>>
>> Of course, String.class would be extracted by compiler.
>>
>> However, as the final transformation are activated by types(), it seems
we can turn the sharp to be

>>
>> ds1.join(ds2).where(0).equalTo(0)
>> .projectSecond(2)
>> .projectFirst(1)
>>                 .types();
>>
>> or rename types() here like doJoinProject()..
>>
>> Does it make sense or anything wrong here?
>>
>> Cheers!
>> -Chen
>> ​ Xu​
>>