I have a dataframe which has a JSON in one of its column. I am trying to use JSONSchema function to validate the JSON present in the column.
validated_df=df.withColumn(“validated”,validate(col(“json_column”),schema))
This is giving me an error:
TypeError: unexpected type: <class ‘type’>
I know validate function requires an object as instance , how do i convert column to object?
tech stack : pyspark, databricks
New contributor
RSH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.