There are important metadata registered in the tables by

```
create table t1 (
  column1 type COMMENT '... the comments1...',
  column2 type COMMENT '... the comments2...'
  ...
);

```

in our database hundreds of tables, and hundreds of column's `COMMENT` for each table.

We need Spark or HQL statement to obtain SQL column comments.

How to do **some serious information retrieval about it?** I need it as a [first class table](https://en.wikipedia.org/wiki/First-class_citizen),... Or, if it is impossible, a **JSON** or [standard MIME CSV file](https://www.rfc-editor.org/info/rfc4180) with all metadata.

---

NOTES:

* We use both, direct Hive SQL and Spark, so any answer (HQL or Scala/Spark script) is valid.
* Not need [to **scrape**](https://en.wikipedia.org/wiki/Data_scraping) *SHOW/DESCRIBE TABLES* command, need serious solution.
* [This question](https://stackoverflow.com/q/6752169/287948) is similar, but restricted to MySQL... The only clue is to do some direct acess to the Metastore (in our config seems Derby SQL schema - no standard).
* [This other question](https://stackoverflow.com/q/57401967/287948) also about "serious information retrieval" of metadata.