cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

TIME data type

TamD
Contributor

Our business does a LOT of reporting and analysis by time-of-day and clock times, independent of day or date.  Databricks does not seem to support the TIME data type, that I can see.  If I attempt to import data recorded as a time (eg., 02:59:59.000), Databricks appends today's date to it.  The docco for the TIMESTAMP data type does not offer any options that don't have a DATE component.

The only alternative seems to be to import as a string, and then do some kind of conversion every single time that data gets used anywhere -- and it's going to be used just about everywhere.

Does anyone have a clean solution for this?  Have I missed something obvious?

1 REPLY 1

szymon_dybczak
Contributor III

Hi @TamD ,

Basically, it's just like you've written. There is no TIME data type, so you have 2 options which you already mentioned:

 you can use Timestamp data type and ignore its date part

-  store it as string and do conversion each time you need it

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group