title: Spark Scala, how to check if nested column is present in dataframe
body: <p>I'm reading a dataframe from parquet file, which has nested columns (<code>struct</code>).
  How can I check if nested columns are present?</p>
  
  <p>It might be like this</p>
  
  <pre><code>+----------------------+
  | column1              |
  +----------------------+
  |{a_id:[1], b_id:[1,2]}|
  +----------------------+
  </code></pre>
  
  <p>or like this </p>
  
  <pre><code>+---------------------+
  | column1             |
  +---------------------+
  |{a_id:[3,5]}         |
  +---------------------+
  </code></pre>
  
  <p>I know, how to check if top-level column is present, as answered here: <a href="https://stackoverflow.com/q/35904136">How do I detect if a Spark DataFrame has a column</a> :</p>
  
  <pre><code>df.schema.fieldNames.contains("column_name")
  </code></pre>
  
  <p>But how can I check for nested column?</p>