facebook/presto — pull request #1904 by miniway (2014-11-05 22:21:56+00:00)
Title: Table writers need to be closeable

Current table write operators, `CREATE TABLE tbl AS' and `INSERT INTO` support `commit` when they sucessfully finish their operations. But when they fails during writes or are cancelled by user, `commit` is not called. So there's no point of releasing resources and rolling back operations.

Like as other adapters of operators, it would be nice if adapters are closeable and `close` is called at operators' `finish` whether they success or not. Adapters could safely close resources and rollback if commit is not invoked.