materialize_sql function

Materialize a user supplied SQL statement as a table.