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
Esteemed 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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now