flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kürşat Kurt <kur...@kursatkurt.com>
Subject Index conversion
Date Mon, 17 Apr 2017 20:33:22 GMT
Hi;

 

I have label index DataSet and final DataSet that i want to convert its
indexes to labels.

 

ixDS: DataSet[(Long, String)]

(1,Car)

(2,Sports)

(3,Home)

...

 

finalDS:DataSet[(Long, String, Double, String, Double)]

(1,x,1,y,4)

(2,z,3,t,5)

...

 

If i want to convert finalDS's indexes with join like this:

 

val res=finalDS.join(ixDS).where(0).equalTo(0){(l,r)=> {

        (r._2,l._2)

        }} 

res.print();

 

I can not get labed indexes. 

If i collect and try to match each DS i could get labels :

 

finalDS.collect().foreach(x=>{

        ixDS.collect().foreach(y=> {

          if (x._1==y._1) System.err.println(">>>>>>>>"+x._2+","+y._2)

        })

      })

 

.. but i think it is the wrong way.

What is the correct way for conversion?


Mime
View raw message