I have a dataset ds1 with following schema
root
|-- binary_col1: binary (nullable = true)
which i transform as needed using
val ds2 = ds1.map(row => row.getAs[Array[Byte]]("binary_col1"))
But how do I transform the dataset when it has two columns of binary type ?
root
|-- binary_col1: binary (nullable = true)
-- binary_col2: binary (nullable = false)
I want to create new dataset with 2 columns
( binary_col1.toByteArray , binary_col2.toByteArray)