Convert a delta table (flattened json format) to a nested java object

tbmadhav
New Contributor

I have a delta table with columns like below format. I am querying Databricks using databricks-jdbc 2.7.1 driver. I want to convert the result set to a nested java object.
Order_actualPickupAddress_residential -> string
Order_pickupRequestDetails -> array<struct<pickupRequestOccurenceNumber:string,payorContact:struct<personName:string,companyName:string,phoneNumber:string>,pickupAddress:struct<classification:string,streetLines:array<string>,city:string,stateOrProvinceCode:string,postalCode:string,countryCode:string,residential:string>,softwareId:string,softwareVersion:string,deviceType:string,serviceOfferingId:string,primaryOrderConfirmationIdDetails:array<struct<id:string,type:string>>,requestReceivedDateTime:string,pickupDetailsByDay:array<struct<expectedDate:string,performingOpCo:string,expectedDateTimeWindow:struct<startDateTime:string,endDateTime:string>,attemptEngagementWindow:struct<startDateTime:string,endDateTime:string>,attemptOutcome:string>>>>

I have a java object "Order" which has an object "pickupRequestDetails" which internally have "payorContact" object. what is an easy way to map 100s of such nested fields?