title: How does the fieldIndex method work in a Spark SQL Row object?
body: <p>While I was looking at the <a href="https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala" rel="nofollow">code</a> for <code>Row</code>, I came across these,</p>
  
  <pre><code>def schema: StructType = null
  
  def fieldIndex(name: String): Int = {
    throw new UnsupportedOperationException("fieldIndex on a Row without schema is undefined.")
  }
  </code></pre>
  
  <p>which doesn't look like much of a code for doing what they're supposed to be doing. So I was wondering how did they actually work? Maybe the actual definition is defined somewhere else?</p>