In the above statement, x(2) is specifying an array and hence it cannot be compared with a string. It represents the second element of the rdd and if you didn't specify the second element, how can it be compared. If you still want to execute this statement then you will have to use split function.
The below statement is the same as the above statement after using split function. x._2 represents the value of the second element of the rdd.
Hope it helps!
If you want to know more about Apache Spark Scala, It's highly recommended to go for Apache Spark certification course today.
Thanks!!