Hi. I want a dataset join with itself. So i tried below codes.

1. newGnsDS.joinWith(newGnsDS, $"dataType”)

2. newGnsDS.as("a").joinWith(newGnsDS.as("b"), $"a.dataType" === $"b.datatype”)

3. val a = newGnsDS.map(x => x).as("a")
   val b = newGnsDS.map(x => x).as("b")
      
   a.joinWith(b, $"a.dataType" === $"b.datatype")

1,2 doesn’t work, but 3 works. I don’t know why it works, better idea exists. 
please help

Reply via email to