SailajaB
Databricks Partner

We used below condition to resolve the issue

if dict(df.dtypes)['test'] != 'array<string>':

df = df.withColumn("test",col("test").cast(newteststruct))

Thank you

View solution in original post