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.
My data Looks like this:
df:
root
|-- KW: integer (nullable = true)
|-- grund: long (nullable = true)
|-- text_rotschaltung: string (nullable = true)
|-- Anzahl: long (nullable = false)
ColumnFilter:
root
|-- grund: long (nullable = true)
The column "grund" is an identifier for the reason from failures. And in my report the user shall be filter interactively which reasons he wants to see.
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.