the resulting comment is looking nothing like it does in edit modethis is the functiondef to_datetime_(col, format):
# Spark 2.2 or later syntax, for < 2.2 use unix_timestamp and cast
return coalesce(to_date(col, format))
Registered to post this so forgive the formatting nightmare
This is a python databricks script function that allows you to convert from string to datetime or date and utilising coalescefrom pyspark.sql.functions import coalesce, to_date
def to_dat...
You gave him scala code, his code is obviously python"Databricks notebooks" can be python, scala even SQL so my advice is check the question and answer in the language they are using at least (both if you know it for future people)