TIME data type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 04:48 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 02:02 AM
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
![](/skins/images/B38AF44D4BD6CE643D2A527BE673CCF6/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/B38AF44D4BD6CE643D2A527BE673CCF6/responsive_peak/images/icon_anonymous_message.png)