Use of case keyword in Apache Spark Coding
<p>In many samples of Apache Spark code we can the below code </p>

<pre><code>val input = sc.hadoopFile[Text, Text, KeyValueTextInputFormat](inputFile).map{
   case (x, y) =&gt; (x.toString, y.toString)
}
</code></pre>

<p>Can someone please explain the use of <code>case (x,y)</code> here? I am aware of the use of case statement for class creation and pattern matching. However I am unable to understand the user of <code>case (x,y</code> in map function here. </p>