AWS Glue Databricks

Use AWS Glue for Databricks

Databricks Deployment has a central Hive Metastore by Default for Data Catalog. There will be option to utilize External Hive Metastore Instance or AWS Glue Catalog.

This post will walkthrough the steps to Integrate AWS Glue Catalog as the Metastore for Databricks Runtime

Step 1 : In AWS Console

Create an instance profile to access a Glue Data Catalog. Attach the below Policy

  "Version": "2012-10-17",
  "Statement": [
      "Sid": "GrantCatalogAccessToGlue",
      "Effect": "Allow",
      "Action": [
      "Resource": [

Step 2 : In AWS Console

Modify the Instance profile created for Databricks EC2 access . This is to allow Databricks to pass the instance profile you created in Step 1 to the EC2 instances for the Spark clusters.

  "Version": "2012-10-17",
  "Statement": [
      "Sid": "Stmt1403287045000",
      "Effect": "Allow",
      "Action": [
      "Resource": [
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::<aws-account-id-databricks>:role/<iam-role-for-glue-access>"

Replace the arn in the above “PassRole” with your Databricks IAM role.

Step 3 : In Databricks Workspace

Add the Glue Catalog instance profile to a Databricks workspace

  1. Go to the admin console.
  2. Click the Instance Profiles tab.
  3. Click the Add Instance Profile button. A dialog displays.
  4. Paste in the Instance Profile ARN from Step 1.Instance profile ARN

Step 4: In Databricks Workspace

  1. Create a cluster.
  2. Click the Instances tab on the cluster creation page.
  3. In the Instance Profiles drop-down list, select the instance profile.Select instance profile
  4. Verify that you can access the Glue Catalog, using the following command in a notebook
show databases;

If the command succeeds, this Databricks Runtime cluster is configured to use Glue.