ChangeChanged the call to sc.read.schema(final_schema).text('/path') because text(...)text(...) will return a dataframe instance and you need to set schema before that.
Change the call to sc.read.schema(final_schema).text('/path') because text(...) will return a dataframe instance and you need to set schema before that.
Changed the call to sc.read.schema(final_schema).text('/path') because text(...) will return a dataframe instance and need to set schema before that.
Change the call to sc.read.schema(final_schema).text('/path') because text(...) will return a dataframe instance and you need to set schema before that.