News for hackers. Stuff that matters.
Re:Why isn’t there a decent file format for tabular data? by zoomablemind on Tuesday May 03, 2022 @11:20PM (#31256384)
What's so special about having a named type for datetime? User will still need to call functions to manipulate the dates. If only for the default display and import?
Re:Why isn’t there a decent file format for tabular data? by pmontra on Wednesday May 04, 2022 @02:02AM (#31257194)
I've seen a sqlite database with datetimes in three different formats in the same field, because different parts of the application I inherited had different ideas of how to write a datetime and sqlite accepts everything. It's only a string after all.

That's a mistake that the same bad developer couldn't have done with a PostgreSQL or a MySQL.

Re:Why isn’t there a decent file format for tabular data? by zoomablemind on Wednesday May 04, 2022 @05:25AM (#31258325)
I understand that SQLite can store datetime in REAL type no problems, just on import one needs to convert the date strings properly. Of course, stuffing strings verbatim may work too, but that's about the robustness of the load process or the ETL pipeline.
Re:Why isn’t there a decent file format for tabular data? by PeterisP on Wednesday May 04, 2022 @12:28AM (#31256765)
For dates, having a specific date type instead of a text field is required to have proper behavior when sorting and efficient storage/data transfer.

It's also important to have date-related functions on the DB server side, so that you can use them in filtering data before it gets sent over to the user code running on the client, to avoid unnecessary data transfer and allow proper use of indexes in optimizing it.

Also, it is nice if a DB engine can perform the equivalent of `WHERE year(date)=2021` without actually running that function on every date, but rather automatically optimize it to an index lookup of `WHERE date between '2021-01-01' and '2021-12-31'`.

Re:Why isn’t there a decent file format for tabular data? by zoomablemind on Wednesday May 04, 2022 @09:53AM (#31260416)
> ...`WHERE year(date)=2021` without actually running that function on every date, but rather automatically optimize it to an index lookup of `WHERE date between '2021-01-01' and '2021-12-31'`

Sure this would be handy. Are there engines that implement such optimization?

I can also see how the 'dated' WHERE clause could be used directly in SQLite to leverage the index. Of course, using year() is more expressive. It may also make sense in such a case to simply add a year column and have it indexed.

Re:Why isn’t there a decent file format for tabular data? by GekkePrutser on Wednesday May 04, 2022 @07:38AM (#31259110)
Having a standardised format for data from different sources. If there's no standard people will use their OS specific format. That makes it harder to compare datasets from different sources