title: Rename nested field name while creating nested pyspark data frime
body: <pre><code>SELECT DISTINCT 
  POA_KEY addressIdentifier,
  PROV_SPCLTY_CERTFN_STTS_CD spcltyBoardCertificationCode,
  PROV_SPCLTY_CERTFN_STTS_CD txnmyBoardCertificationCode,
  SPCLTY_CD_VAL specialtyCode,
  SPCLTY_CD_VAL_NM specialtyCodeName,
  SPCLTY_CD_VAL_DESC specialtyCodeDesc,
  SPCLTY_CTGRY_CD_VAL specialtyCategoryCode,
  SPCLTY_CTGRY_CD_VAL_NM specialtyCategoryName,
  SPCLTY_CTGRY_CD_VAL_DESC specialtyCategoryDesc,
  TXNMY_CD_VAL taxonomyCode,
  TXNMY_CD_VAL_NM taxonomyCodeName,
  TXNMY_CD_VAL_DESC taxonomyCodeDesc
  FROM TEST A
  </code></pre>
  <p>I am creating a df from above query. and making a nested df using agg.</p>
  <pre><code>contact_df_gp= exprt_df.groupby('addressIdentifier').agg(
    
      f.collect_list(
        f.struct('contactListCode','contactListDesc','contactListNm','phoneNumber')
      
    ).alias('contactLis'),
      f.collect_list(
        f.struct('displayUrl','urlName')
    ).alias('webContactList')
  )
  </code></pre>
  <p>I need to rename  contactListCode -&gt; Code ,contactListDesc-&gt;Desc and contactListNm -&gt; Name</p>
  <p>Expected out put.</p>
  <pre><code>{&quot;addressIdentifier&quot;:1000105107,&quot;contact&quot;:[{&quot;Code&quot;:&quot;B&quot;,&quot;Desc&quot;:&quot;BUSINESS&quot;,&quot;Name&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;8037735227&quot;},{&quot;Code&quot;:&quot;B&quot;,&quot;Desc&quot;:&quot;BUSINESS&quot;,&quot;Name&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;8037735227&quot;}],&quot;contactweb&quot;:[{&quot;displayUrl&quot;:&quot;FALSE&quot;},{&quot;displayUrl&quot;:&quot;FALSE&quot;}]}
  {&quot;addressIdentifier&quot;:1000000001,&quot;contact&quot;:[{&quot;Code&quot;:&quot;B&quot;,&quot;Desc&quot;:&quot;BUSINESS&quot;,&quot;Name&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;7045403667&quot;},{&quot;Code&quot;:&quot;B&quot;,&quot;Desc&quot;:&quot;BUSINESS&quot;,&quot;Name&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;7045403667&quot;},{&quot;contactListCode&quot;:&quot;B&quot;,&quot;contactListDesc&quot;:&quot;BUSINESS&quot;,&quot;contactListNm&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;7045403667&quot;},{&quot;contactListCode&quot;:&quot;B&quot;,&quot;contactListDesc&quot;:&quot;BUSINESS&quot;,&quot;contactListNm&quot;:&quot;BUSINESS&quot;,&quot;phoneNumber&quot;:&quot;7045403667&quot;}],&quot;contactweb&quot;:[{&quot;displayUrl&quot;:&quot;FALSE&quot;},{&quot;displayUrl&quot;:&quot;FALSE&quot;},{&quot;displayUrl&quot;:&quot;FALSE&quot;},{&quot;displayUrl&quot;:&quot;FALSE&quot;}]}
  </code></pre>