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?

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