2

In my scenario the column my_url can be at first level or inside the nested column how to change the value of the column recursively.the nested column can be a StructType or ArrayType and my_url either it can be at 2nd level

root
 |-- _id: struct (nullable = true)
 |    |-- oid: string (nullable = true)
 |-- websites: struct (nullable = true)
 |    |-- cb_url: string (nullable = true)
 |    |-- domain_url: string (nullable = true)
 |    |-- email: string (nullable = true)
 |    |-- facebook_url: string (nullable = true)
 |    |-- homepage_url: string (nullable = true)
 |    |-- linkedin_url: string (nullable = true)
 |    |-- my_url: string (nullable = true)
 |    |-- phone: string (nullable = true)
 |    |-- twitter_url: string (nullable = true)

or it can be at 1st level:

root
 |-- _id: struct (nullable = true)
 |    |-- oid: string (nullable = true)
 |-- my_url: string (nullable = true)
 |-- facebook_url: string (nullable = true)

or like the below

root
 |-- _id: struct (nullable = true)
 |    |-- oid: string (nullable = true)
 |-- investments: struct (nullable = true)
 |    |-- investment_list: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- funding_round_info: struct (nullable = true)
 |    |    |    |    |-- announced_on: timestamp (nullable = true)
 |    |    |    |    |-- my_url: string (nullable = true)

it can be at any level.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.