What is the difference between Spark Row and Scala List, both provide a way to access items by Index When to use which one
The only difference I can see in Row is that it has some schema.
scala> val a=Row(1,"hi",2,"hello")
a: org.apache.spark.sql.Row = [1,hi,2,hello]
scala> a(0)
res61: Any = 1
scala> a(2)
res62: Any = 2
scala> a(3)
res63: Any = hello
scala> val b=List(1, "hi", 2,"hello")
b: List[Any] = List(1, hi, 2, hello)
scala> b(1)
res64: Any = hi
scala> b(2)
res65: Any = 2
scala> b(3)
res66: Any = hello
Please help me understand why Row came into the picture.