Sorry, I forgot to add exception handle and close table later. As discussion in [SPARK-1127](https://spark-project.atlassian.net/browse/SPARK-1127), I would try to provide a higher-level abstraction for this.