Option B is correct. The function to_date converts a timestamp or date-like expression to a date value, which matches the requirement to extract the date from the timestamp field. unix_timestamp converts to a Unix timestamp value, date_format formats a date or timestamp as a string, and from_unixtime converts Unix time into a timestamp/string representation. Official Databricks documentation states that to_date(expr [, fmt]) returns the expression cast to a date.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit