I'm trying to create a data frame on a text file. For a sample input (**Input1**)
 below **Code** is working fine

**Input1**

```
1,5

2,6

3,7

4,8

```

**Output1**

```
+---+----+
| id|name|
+---+----+
|  1|   5|
|  2|   6|
|  3|   7|
|  4|   8|
+---+----+

```

However when I changed the input(**Input2**), I'm not getting any output.

**Input2**

```
1,"a,b,c"

2,"d,e,f"

3,"a,b,c"

4,"a,d,f"

```

**Output2**

```
+---+----+
| id|name|
+---+----+
+---+----+

```

**Code**

```
    {
        val input = sc.textFile(inputFile).map(x=>x.split(",")).collect {
                            case Array(id,name) => Record(id.toInt, name)
                    }
                    input.toDF().show()
    }
case class Record(id: Int, name: String)

```

**Expected output format for Input2**

```
+---+-----+------+-----+
| id|name1| name2|name3|
+---+-----+------+-----+
|  1|    a|     b|    c|
|  2|    d|     e|    d|    
|  3|    a|     b|    c|
|  4|    a|     d|    f|
+---+-----+------+-----+

```

I should make changes to the code and case class as well so that compiler understands the data format for **Input2**, but I'm not getting what changes I need to do. Please advice.