5 ms·
In my view our collective interest in CSV as a medium for data distribution has resulted in far too much information loss, and consequently, time wasted on inpu
by cbetti 6y ago
In my view our collective interest in CSV as a medium for data distribution has resulted in far too much information loss, and consequently, time wasted on input sanitization, validity checking, and unresolvable conversations about the intent of data values like ”1.12345E+11” and "".
- emersion 6y agoCSV is just an example, data vendors can choose e.g. JSON if they want more a sane and well-defined format.
- pletnes 6y agoJson has many design flaws, e.g. support for large integers, floating point infinity and NaN, for instance.
- shawnz 6y agoIt is not a design flaw to make a reasonable choice about what data types you support. Especially given the ones captured in JSON are overwhelmingly the most commonly used and necessary types. In cases where that's not enough, you could roll your own types by putting the values in plain strings and it would still be strictly more expressive than CSV
- still_grokking 6y agoRegarding "sane & well-defined": http://seriot.ch/parsing_json.php http://seriot.ch/parsing_json.php
- paulgb 6y agoHaving spent way too much time wrangling vendor-provided CSVs, I 100% agree. I'd love for there to be a common, well-understood format for typed tabular data that supports multiple tables and enforces foreign keys between them. Ideally with a concept of "patching" to enable incremental updates. Probably the closest thing I'm aware of is handing around a sqlite file, but I'm a little uneasy using a format that's meant to be a database as a transfer format. Dolt looks promising here too. Are there other ways?
- itroot 6y agohttps://www.sqlite.org/appfileformat.html https://www.sqlite.org/appfileformat.html - it is OK to use sqlite that way! =)
- mildbyte 6y agoThe Splitgraph core code on GitHub [0], around which we've built the DDN, is all about managing "data images" which are basically snapshots of PostgreSQL schemata. You can build them with a format similar to Dockerfiles as well as do a "checkout" into a local instance of Splitgraph (which you can connect to with any PG client) -- this enables change tracking and delta compression too. Behind the scenes, we store them as cstore_fdw [2] files which is a columnar storage format that helps with analytical queries. [0] https://github.com/splitgraph/splitgraph/ https://github.com/splitgraph/splitgraph/ [1] https://splitgraph.com/docs/concepts/images https://splitgraph.com/docs/concepts/images [2] https://github.com/citusdata/cstore_fdw https://github.com/citusdata/cstore_fdw
- Fiahil 6y agoAt work, we use Parquet (https://parquet.apache.org/ https://parquet.apache.org/) for almost everything related to a dataframe. We don't really care about performance gains (although, it's nice to have), but we really like to have a schema. Note, we use mostly Python, some R, and a various range of ML or Optimisation tools, depending on the project.
- jeremyjh 6y agoDoes Parquet provide a way to define foreign keys between different tables in a single dataset?
- xyzzy_plugh 6y agoParquet files don't reference anything outside of the file, usually. A group of parquet files in a folder is usually considered a table, where the schema is union of the schema of the files.
- xyzzy_plugh 6y ago
- hodgesrm 6y agoThe thing that attracted me to SplitGraph from the very start is that they are proposing to make the PostgreSQL wire protocol and SQL dialect a general interface to remote data. The interface is not only well known but backed by permissively licensed, open source libraries. Plus there are hundreds of tools that already connect to PostgreSQL. This idea makes such sense it's a little surprising nobody did it before.
- johnthescott 6y agorun-away queries become a problem when direct sql is exposed to public.
- rrrrrrrrrrrryan 6y agoBoth JSON and XML are self-documenting, and most modern databases support directly importing and exporting them. Though the tools to accomplish this could be better, these formats are far better suited as a "medium for data distribution" than CSV files are. That said, a simple compressed .sql file of INSERT statements can often go a long way. The only reason CSV is widely used is because normal people think of data as spreadsheets, and asking them to fire up a database and shred JSON data into it is ridiculous when they just want to whip up a line graph or answer a simple question (e.g. "What was value X on a this particular date?").