title: Add multiple columns with map logic without using UDF
body: <p>I want to parse the address column from the given table structure using addressParser function to get number, street, city and country.</p>
  <p><strong>Sample Input:</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>addressId</th>
  <th>address</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>ADD001</td>
  <td>&quot;384, East Avenue Street, New York, USA</td>
  </tr>
  <tr>
  <td>ADD002</td>
  <td>&quot;123, Maccolm Street, Copenhagen, Denmark&quot;</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The sample code is attached for reference:</p>
  <pre><code>
  object ParseAddress extends App {
  
    val spark = SparkSession.builder().master(&quot;local[*]&quot;).appName(&quot;ParseAddress &quot;).getOrCreate()
  
    import spark.implicits._
  
    case class AddressRawData(addressId: String, address: String)
  
    case class AddressData(
                            addressId: String,
                            address: String,
                            number: Option[Int],
                            road: Option[String],
                            city: Option[String],
                            country: Option[String]
                          )
  
   def addressParser(unparsedAddress: Seq[AddressData]): Seq[AddressData] = {
      unparsedAddress.map(address =&gt; {
        val split = address.address.split(&quot;, &quot;)
  
        address.copy(
          number = Some(split(0).toInt),
          road = Some(split(1)),
          city = Some(split(2)),
          country = Some(split(3))
        )
      }
      )
    }
  
    val addressDS: Dataset[AddressRawData] = addressDF.as[AddressRawData]
  
  }
  </code></pre>
  <p><strong>Expected output</strong>:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>addressId</th>
  <th>address</th>
  <th>number</th>
  <th>road</th>
  <th>city</th>
  <th>country</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>ADD001</td>
  <td>&quot;384, East Avenue Street, New York, USA</td>
  <td>384</td>
  <td>East Avenue Street</td>
  <td>New York</td>
  <td>USA</td>
  </tr>
  <tr>
  <td>ADD002</td>
  <td>&quot;123, Maccolm Street, Copenhagen, Denmark&quot;</td>
  <td>123</td>
  <td>Maccolm Street</td>
  <td>Copenhagen</td>
  <td>Denmark</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am not sure how should I convert addressDS as an input to function to parse the column data. Some form of help to solve this problem is very much appreciated.</p>