将 Delta Lake 集群与 Spark 和 Amazon Glue 结合使用 - Amazon EMR
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

将 Delta Lake 集群与 Spark 和 Amazon Glue 结合使用

要将 Amazon Glue 数据目录作为 Delta Lake 表的元存储,请按如下步骤创建集群。有关使用 Amazon Command Line Interface 指定 Delta Lake 分类的信息,请参阅在创建集群时使用 Amazon Command Line Interface 提供配置Supply a configuration using the Java SDK when you create a cluster(在创建集群时使用 Java SDK 提供配置)。

创建 Delta Lake 集群
  1. 创建文件 configurations.json 并输入以下内容:

    [{"Classification":"delta-defaults", "Properties":{"delta.enabled":"true"}}, {"Classification":"spark-hive-site", "Properties":{"hive.metastore.client.factory.class":"com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"}}]
  2. 使用以下配置创建集群,将 example Amazon S3 bucket pathsubnet ID 替换为您自己的值。

    aws emr create-cluster --release-label emr-6.9.0 --applications Name=Spark --configurations file://delta_configurations.json --region us-east-1 --name My_Spark_Delta_Cluster --log-uri s3://amzn-s3-demo-bucket/ --instance-type m5.xlarge --instance-count 2 --service-role EMR_DefaultRole_V2 --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole,SubnetId=subnet-1234567890abcdef0