没有规定将Scala中的Spark DataFrame转换为AWS Glue DynamicFrame

时间:2018-11-23 09:55:36

标签: amazon-web-services apache-spark aws-glue

下面的代码没有等效的东西可以从Spark DataFrame转换为Glue DynamicFrame,这是故意的,解决方法是什么?

# Convert to a dataframe and partition based on "partition_col"
partitioned_dataframe = datasource0.toDF().repartition(1)

# Convert back to a DynamicFrame for further processing.
partitioned_dynamicframe = DynamicFrame.fromDF(partitioned_dataframe, glueContext, "partitioned_df")

1 个答案:

答案 0 :(得分:1)

使用此:

# Convert Spark's DataFrame to Glue's DynamicFrame
val partitioned_dynamicframe = DynamicFrame(partitioned_dataframe, glueContext)