如果您遵循AWS Glue添加作业向导创建脚本以将镶木地板文件写入S3,则最终会生成类似以下的代码。
datasink4 = glueContext.write_dynamic_frame.from_options(
frame=dropnullfields3,
connection_type="s3",
connection_options={"path": "s3://my-s3-bucket/datafile.parquet"},
format="parquet",
transformation_ctx="datasink4",
)
是否可以指定KMS密钥,以便在存储桶中对数据进行加密?
胶水scala工作
val spark: SparkContext = new SparkContext()
val glueContext: GlueContext = new GlueContext(spark)
spark.hadoopConfiguration.set("fs.s3.enableServerSideEncryption", "true")
spark.hadoopConfiguration.set("fs.s3.serverSideEncryption.kms.keyId", args("ENCRYPTION_KEY"))
我认为Python的语法应该有所不同,但思路相同
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句