I want to add new 2 columns value services arr first and second value but I'm getting the error:
Field name should be String Literal, but it's 0;
production_target_datasource_df.withColumn("newcol",production_target_datasource_df["Services"].getItem(0))
+------------------+--------------------+
| cid | Services|
+------------------+--------------------+
|845124826013182686| [112931, serv1]|
|845124826013182686| [146936, serv1]|
|845124826013182686| [32718, serv2]|
|845124826013182686| [28839, serv2]|
|845124826013182686| [8710, serv2]|
|845124826013182686| [2093140, serv3]|

production_target_datasource_df.printSchema().