EMR with Glue Data Catalog as Hive Metastore

0

I am trying to have glue data catalog as the hive metastore, stood up the EMR(emr-6.15.0) with the following node classification config per AWS, and it always initialize a default glue catalog database there, is there a hive/EMR config for disabling that auto creation or use an alternative database in glue on start up?

Thank you

Installed applications Hadoop 3.3.6, Hive 3.1.3, JupyterEnterpriseGateway 2.6.0, Livy 0.7.1, Spark 3.4.1

[
  {
    "Classification": "delta-defaults",
    "Properties": {
      "delta.enabled": "true"
    }
  },
  {
    "Classification": "spark-hive-site",
    "Properties": {
      "hive.metastore.client.factory.class": "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"
    }
  }
]
spark = SparkSession.builder \
.config("spark.jars", "/usr/share/aws/delta/lib/delta-core_2.12-2.4.0.jar") \
.config("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension") \
.config("spark.sql.catalog.spark_catalog", "org.apache.spark.sql.delta.catalog.DeltaCatalog") \
.config("hive.metastore.client.factory.class", "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory") \
.appName("test") \
.enableHiveSupport() \
.getOrCreate()
zying
已提问 5 个月前409 查看次数
1 回答
3
已接受的回答

Hello,

As far as I know, you need default database in glue data catalog as a default database and deleting it might cause issues. In AWS Glue job’s catalog integration, AWS Glue always tries to check whether default database exists or not using AWS Glue GetDatabase API. When the DESCRIBE Lake Formation permission is not granted, or GetDatabase IAM permission is granted, then the job fails when verifying existence of the default database.

"default" database is the one that hive uses by default which can not be changed or set to other dbs. However,

To see the tables belonging to your "user_created_database": run,

show tables from user_created_database;

Then, to run your queries, you can either specify the full table name using the notion database.table:

select * from user_created_database.your_table

or you can change database (i.e., USE statement) and then run your queries:

use user_created_database; show tables;

AWS
支持工程师
已回答 5 个月前
profile picture
专家
已审核 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则