| copyright |
|
||
|---|---|---|---|
| lastupdated | 2022-10-30 | ||
| subcollection | AnalyticsEngine |
{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:codeblock: .codeblock} {:screen: .screen} {:pre: .pre} {:note: .note} {:important: .important} {:external: target="_blank" .external}
{: #external-metastore}
Spark SQL uses Hive metastore to manage the metadata of a user's applications tables, columns, partition information.
By default, the database that powers this metastore is an embedded Derby instance that comes with the Spark cluster. You could choose to externalize this metastore database to an external data store, like to an {{site.data.keyword.databases-for-postgresql_full_notm}} or an {{site.data.keyword.sqlquery_notm}} (previously SQL Query) instance.
Placing your metadata outside of the Spark cluster will enable you to reference the tables in different applications across your {{site.data.keyword.iae_full_notm}} instances. This, in combination with storing your data in {{site.data.keyword.cos_full_notm}}, helps persisting data and metadata and allows you to work with this data seamlessly across different Spark workloads.
{: #test-external-metastore-with-iae}
To enable and test an external metastore with {{site.data.keyword.iae_full_notm}}, you need to perform the following steps:
- Create a metastore to store the metadata. You can choose to provision either an {{site.data.keyword.databases-for-postgresql_full_notm}} or an {{site.data.keyword.sqlquery_notm}} (previously SQL Query) instance.
- Configure {{site.data.keyword.iae_full_notm}} to work with the database instance.
- Create a table in one Spark application and then access this table from another Spark application.