Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oracle has a feature called external tables that lets you map regular files to the database and run SQL against them. Works with csv or any format that can be loaded to the database with the normal database loading utilities. This is very useful for getting transformation and loading done in one step!


MySQL has a barebones CSV storage engine: https://dev.mysql.com/doc/refman/8.0/en/se-csv-limitations.h...

More usefully, MySQL has LOAD DATA INFILE facilities for bulk loading of flat files.


The feature actually uses the syntax from the old SQLLDR tool, and can also specify fields in absolute columnar position as well as defining delimiters (reminiscent of gawk). There are also conditionals (when), rounding rules, and other transformations.


A fantastic feature - I've used it regularly in the past to load large log files into the database with incredible performance.


Postgres also has this feature (via file_fwd)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: