Type: New Feature
Affects Version/s: None
Fix Version/s: None
For many datastore types there is only going to be one table in the default schema. Examples of this would be CSV files, most Excel spreadsheets, Fixed width files etc. Or just simple databases with just one table.
It would be super convenient if I could express a string query (to be parsed) like this:
(Although "default table" is maybe not an ideal identifier for this. To be revisited below)
This would allow me to apply the same query to many datastores without having to spend time and energy finding out what the table name is. For example if I'm working on a lot of CSV files, I know that I can apply this same query again and again.
The evaluation of the FROM clause would happen at query time. That way it wouldn't need to carry this information on to any MM submodule or anything like that. It would just enter the generic query parsing logic that also transforms the asterix in the SELECT clause into concrete select items.
It's interesting to consider naming here. Default schemas are already supported, but they are unnamed because they exist simply when no schema is specified. But in a FROM clause we need some token for it to be valid SQL (or even just SQL-like) syntax. Therefore I could imagine a couple of possible tokens/syntaxes in addition to the "default table" idea above:
- SELECT * FROM default
- SELECT * FROM table
- SELECT * FROM tables
- SELECT * FROM _
I think I like option 3 or 4 most actually. Option 1 and 2 have the issues that there could be name clashes if there are actual table names called "default" or "table". It would be cool with the "tables" option, and having the option to also reference non-zero table indices in there. That way you could even take the idea of querying generically further by doing so for all indices if you happen to know how many tables to expect.