You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Kürşat Kurt <ku...@kursatkurt.com> on 2017/04/17 20:33:22 UTC

Index conversion

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?