title: Dataframe to RDD piece of code is not working
body: <p>I am trying to read each row of dataframe and convert the row data into custom bean class. But the problem here is, the code is not getting executed. To check, I have written multiple print statement but none of the print statement present inside <code>df.rdd.map{row=&gt;}</code> executed as if the complete block of code is escaped.</p>
  
  <p>code snippet:</p>
  
  <pre><code> print("data frame:", df.show()). 
  
   df.rdd.map(row =&gt; {
     // Debugging
     println("Debugging")
  
    if(row.isNullAt(0)) {
      println("null data")
    } else {
      println(row.get(0).toString)
    }
  
    val employeeJobData = new EmployeeJobData
  
    if(row.get(0).toString == null || row.get(0).toString.isEmpty){
      employeeJobData.setEmployeeId("NULL_KEY_VALUE")
    } else {
      employeeJobData.setEmployeeId(row.get(0).toString)
    }
    employeeJobDataList.add(employeeJobData)
    } )
  </code></pre>
  
  <p>output of <code>df.show()</code>:</p>
  
  <pre><code>   |employee_id|employee_name|employee_email|paygroup|level|dept_id|
     +-----------+-------------+--------------+--------+-----+-------+
     |13         |         null|          null|    null| null|   null|
     |14         |         null|          null|    null| null|   null|
     |15         |         null|          null|    null| null|   null|
     |16         |         null|          null|    null| null|   null|
     |17         |         null|          null|    null| null|   null|
     +-----------+-------------+--------------+--------+-----+-------+
  </code></pre>