[ad_1]
I’m working on spark, using scala, i have 2 DataFrames
Schema of DF 1 –
root
|-- employee: struct (nullable = true)
| |-- name: string (nullable = true)
| |-- id: string (nullable = true)
| |-- salary: long (nullable = true)
| |-- dept: string (nullable = true)
|--....
Schema of DF 2-
root
|-- employee: struct (nullable = true)
| |-- name: string (nullable = true)
| |-- id: string (nullable = true)
| |-- salary: long (nullable = true)
| |-- dept: string (nullable = true)
|. |-- phone: string (nullable = false)
how can i add phone
field to employee
field on DF1,
Note: not all employees of DF1 are in DF2, so if employee not present in DF2, the phone
field should be set with 000
[ad_2]