简体   繁体   English

写一个 spark dataframe 或者写一个胶水动态框架,AWS Glue 哪个选项更好?

[英]write a spark dataframe or write a glue dynamic frame, which option is better in AWS Glue?

In AWS Glue, I read the data from data catalog in a glue dynamic frame.在 AWS Glue 中,我从粘合动态框架中的数据目录中读取数据。 Then convert the dynamic frame to spark dataframe to apply schema transformations.然后将动态帧转换为 spark dataframe 以应用模式转换。 To write the data back to s3 I have seen developers convert the dataframe back to dynamicframe.要将数据写回 s3,我看到开发人员将 dataframe 转换回动态帧。 Is there any advantage over writing a glue dynamic frame to writing a spark dataframe?比写胶水动态帧写火花dataframe有什么优势吗?

You will find that there is functionality that is available only to dynamic frame writer class that cannot be accessed when using data frames:您会发现只有动态帧写入器 class 可用的功能在使用数据帧时无法访问:

  1. Writing to a catalog table based on an s3 source as well when you want to utilize connection to JDBC sources.当您想利用与 JDBC 源的连接时,也可以基于 s3 源写入目录表 ie using from_jdbc_conf即使用from_jdbc_conf
  2. Writing to parquet using format glueparquet as a format.使用格式glueparquet作为格式写入镶木地板。
  3. Tracking processed files in the target location using bookmarks使用书签跟踪目标位置中已处理的文件

These are some of the use-cases I can think of, but if you have a use case that requires using save modes, for example, mode('overwrite') you could use data frames.这些是我能想到的一些用例,但如果你有一个需要使用保存模式的用例,例如mode('overwrite') ,你可以使用数据帧。 A similar approach however exists at dynamic frame but is implemented slightly different.然而,类似的方法存在于动态框架中,但实现方式略有不同。 You can take a look at [purge_s3_path][3] then write.你可以看看[purge_s3_path][3]然后写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在 AWS Glue pyspark 中使用 UDF 添加派生列后,将 DataFrame 写入 S3(或将动态帧写入 Redshift)会出错? - Why is write DataFrame to S3 (or write dynamic frame to Redshift) giving error after adding derived column using UDF in AWS Glue pyspark? 使用glueContext.write_dynamic_frame.from_options 的AWS Glue 导出到镶木地板问题 - AWS Glue export to parquet issue using glueContext.write_dynamic_frame.from_options 使用 AWS Glue 将 ACL 权限写入 S3 中的 write_dynamic_frame_from_options - ACL permissions for write_dynamic_frame_from_options in to S3 using AWS Glue AWS Glue 可以写入 DynamoDB 吗? - Can AWS Glue write to DynamoDB? AWS Glue 用分区写镶木地板 - AWS Glue write parquet with partitions 当 AWS glue ETL 作业中的 glueContext.write_dynamic_frame.from_jdbc_conf 返回错误时会发生什么? - What happens when glueContext.write_dynamic_frame.from_jdbc_conf in AWS glue ETL job returns an error? 格式AWS胶火花dataframe output - format AWS glue spark dataframe output 来自数组的 AWS Glue 动态框架列 - AWS Glue Dynamic Frame columns from array AWS Glue 动态框架 - 如果没有数据,则没有列标题 - AWS Glue dynamic frame - no column headers if no data 如何在AWS Glue上编写谓词表达式 - How to write a predicate expression on AWS Glue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM