lundi 18 septembre 2017

SPARK: Fill a checkbox with entries from a column

I want to fill a Checkbox in spark with the distinct values of a column, because in the next step this shall be my filter options.

Actually I have this code part:

...

    val df = rdd1.toDF()
    var ColumnFilter = df.orderBy("grund").select("grund").distinct



println("Hello "+z.checkbox("The reasons:", ColumnFilter).mkString(" and "))

With this code I get the error:

error: type mismatch;
 found   : org.apache.spark.sql.DataFrame
 required: Iterable[(Object, String)]
println("Hello "+z.checkbox("The reasons", ColumnFilter).mkString(" and "))

How can I convert a DataFrame to Iterable or which other Options have I to fill the Checkbox?

Thank you very much.




Aucun commentaire:

Enregistrer un commentaire