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

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

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

要使用 Glue Amazon Catalog 作为 Delta Lake 表格的元数据仓,请按照以下步骤创建一个集群。有关使用指定 Delta Lake 分类的信息 Amazon Command Line Interface,请参阅在创建集群 Amazon Command Line Interface 时使用提供配置或在创建集群时使用 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://DOC-EXAMPLE-BUCKET/ --instance-type m5.xlarge --instance-count 2 --service-role EMR_DefaultRole_V2 --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole,SubnetId=subnet-1234567890abcdef0