HenryOlson / optiq-web

Optiq adapter for HTML tables
Apache License 2.0
13 stars 2 forks source link

Access URLs via a table macro #30

Open julianhyde opened 10 years ago

julianhyde commented 10 years ago

Now that Optiq has table macros (see https://github.com/julianhyde/optiq/issues/222) optiq-web could allow access to web-tables via table-macros. (Table macros are a special kind of table functions that are resolved at prepare-time, just as views are.) For example,

select * from table(web_table(
  'http://en.wikipedia.org/wiki/List_of_United_States_cities_by_population',
  '#mw-content-text > table.wikitable.sortable'));

The advantage to the user is that they don't need to change their schema.

Under the covers, web_table is backed by a class that has an eval(String url, String selector) method that returns a TranslatableTable. That can hook into existing optiq-web classes.