cancel
Showing results for 
Search instead for 
Did you mean: 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi I am trying to change datatype of DOB column from stringtype to DateType but getting issue

parakh17
New Contributor

Hi I am trying to change datatype of DOB column from String type to DateType but getting issue
"SparkUpgradeException: [] You may get a different result due to the upgrading to Spark >= 3.0: Caused by: DateTimeParseException: Text '7/8/1972' could not be parsed at index 0"

I have attached screenshots for your reference. Can someone help. I know this is a silly doubt but help is really appreciated ! Thanks in advance


Screenshot 2024-06-30 at 6.50.42 PM.pngScreenshot 2024-06-30 at 6.50.57 PM.pngScreenshot 2024-06-30 at 6.51.01 PM.png

1 REPLY 1

Witold
New Contributor II

It's because the format you're using it wrong. Use `'M/d/yyyy'` instead.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!