Skip to content

Commit

Permalink
add instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hwang-db committed Jun 22, 2022
1 parent 0965053 commit b449662
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions adb-external-hive-metastore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ We can also check inside the sql db (metastore), we've successfully linked up cl
Now you can config all other clusters to use this external metastore, using the same spark conf and env variables of cold start cluster.


### Notes: Migrate from your existing managed metastore to external metastore


dbs = spark.catalog.listDatabases()
for db in dbs:
f = open("your_file_name_{}.ddl".format(db.name), "w")
tables = spark.catalog.listTables(db.name)
for t in tables:
DDL = spark.sql("SHOW CREATE TABLE {}.{}".format(db.name, t.name))
f.write(DDL.first()[0])
f.write("\n")
f.close()



<!-- BEGIN_TF_DOCS -->
Module creates:
* Resource group with random prefix
Expand Down

0 comments on commit b449662

Please sign in to comment.