title: Split a column in multiple columns with given column name and value in pyspark
body: <p>I have a df like this</p>
  
  <pre><code>+-----+-------+------------+---+---+----+------+--------------------+
  |CHROM|    POS|          ID|REF|ALT|QUAL|FILTER|                INFO|
  +-----+-------+------------+---+---+----+------+--------------------+
  |    1|1014143| rs786201005|  C|  T|   .|     .|RS=786201005;RSPO...|
  |    1|1014228|      rs1921|  G|A,C|   .|     .|RS=1921;RSPOS=101...|
  |    1|1014316| rs672601345|  C| CG|   .|     .|RS=672601345;RSPO...|
  |    1|1014359| rs672601312|  G|  T|   .|     .|RS=672601312;RSPO...|
  |    1|1020183| rs539283387|  G|  C|   .|     .|RS=539283387;RSPO...|
  |    1|1020216| rs764659938|  C|  G|   .|     .|RS=764659938;RSPO...|
  |    1|1020217| rs115173026|  G|  T|   .|     .|RS=115173026;RSPO...|
  |    1|1020221|rs1057523287|  C|  T|   .|     .|RS=1057523287;RSP...|
  |    1|1020239| rs201073369|  G|A,C|   .|     .|RS=201073369;RSPO...|
  |    1|1022188| rs115704555|  A|  G|   .|     .|RS=115704555;RSPO...|
  +-----+-------+------------+---+---+----+------+--------------------+
  </code></pre>
  
  <p>My info column has multiple value separated by ';' which are in the form of 'column_name=value'. I want my df info columns separated in multiple columns on the basis of respective value like this</p>
  
  <pre><code>Pre_Col| Info               |      RS    | RSPOS |dbSNPBuildID| SSR |...|
  -------+--------------------+------------+-------+------------+-----+---+
  ...    |RS=786201005;RSPO...|  786201005 |1012143|  144       |  0  |...|
  ...    |RS=115173026;RSPO...|  115173026 |9043523|  123       |  2  |...|
  </code></pre>
  
  <p>info column can has multiple variable values. It is possible that RS value can not be in other rows, same case can be possible with other values. In that case i want RS value as 'null'. I'm driving this df through a map. </p>
  
  <p>After one suggestion i have edited my code and get below result </p>
  
  <pre><code>+-----+-------+------------+---+---+----+------+--------------------+-----+
  |CHROM|    POS|          ID|REF|ALT|QUAL|FILTER|                INFO|  kvs|
  +-----+-------+------------+---+---+----+------+--------------------+-----+
  |    1|1014143| rs786201005|  C|  T|   .|     .|RS=786201005;RSPO...|Map()|
  |    1|1014228|      rs1921|  G|A,C|   .|     .|RS=1921;RSPOS=101...|Map()|
  |    1|1014316| rs672601345|  C| CG|   .|     .|RS=672601345;RSPO...|Map()|
  |    1|1014359| rs672601312|  G|  T|   .|     .|RS=672601312;RSPO...|Map()|
  |    1|1020183| rs539283387|  G|  C|   .|     .|RS=539283387;RSPO...|Map()|
  |    1|1020216| rs764659938|  C|  G|   .|     .|RS=764659938;RSPO...|Map()|
  |    1|1020217| rs115173026|  G|  T|   .|     .|RS=115173026;RSPO...|Map()|
  |    1|1020221|rs1057523287|  C|  T|   .|     .|RS=1057523287;RSP...|Map()|
  |    1|1020239| rs201073369|  G|A,C|   .|     .|RS=201073369;RSPO...|Map()|
  |    1|1022188| rs115704555|  A|  G|   .|     .|RS=115704555;RSPO...|Map()|
  +-----+-------+------------+---+---+----+------+--------------------+-----+
  </code></pre>
  
  <p>and my schema is </p>
  
  <pre><code>root
  |-- CHROM: string (nullable = true)
  |-- POS: string (nullable = true)
  |-- ID: string (nullable = true)
  |-- REF: string (nullable = true)
  |-- ALT: string (nullable = true)
  |-- QUAL: string (nullable = true)
  |-- FILTER: string (nullable = true)
  |-- INFO: string (nullable = true)
  |-- kvs: map (nullable = true)
  |    |-- key: string
  |    |-- value: string (valueContainsNull = true)
  </code></pre>
  
  <p>Can i split these map values further into columns?</p>
  
  <p>Any help will be appreciated.</p>