Venkat R
Venkat R
Sep 2, 2018 · 1 min read

Awesome Post. As I cannot use Scala in my organization for various reasons. I tried implementing this with Java but I got an error and unable to proceed. can you please be able to help me with that.

The code fragment is as below

Function<Dataset<Row>, Dataset<Row>> myTransform1 = (r) -> {
r.select(“lob”).distinct().show();
};

dfInfile.transform(myTransform1);

The error message says

The method transform(Function1<Dataset<Row>,Dataset<U>>) in the type Dataset<Row> is not applicable for the arguments (Function<Dataset<Row>,Dataset<Row>>)

I am not sure how can I make the second argument of the functional interface as an untyped dataset “Dataset<U>”.

Thanks in Anticipation.

    Venkat R

    Written by

    Venkat R