【问题标题】:AWS Glue Limit Input SizeAWS Glue 限制输入大小
【发布时间】:2018-03-06 14:19:27
【问题描述】:

我想使用一小部分可用数据来测试我的 AWS Glue PySpark 作业。如何实现?

我的第一次尝试是将Glue动态帧转换为spark数据帧,并使用take(n)方法限制要处理的行数如下:

datasource0 = glueContext.create_dynamic_frame.from_catalog(
    database = "my_db",
    table_name = "my_table",
    transformation_ctx = "ds0")

applymapping1 = ApplyMapping.apply(
    frame = datasource0, 
    mappings = [("foo", "string", "bar", "string")],
    transformation_ctx = "am1")

truncated_df = applymapping1.toDF().take(1000)

datasink2 = glueContext.write_dynamic_frame.from_options(
    frame = DynamicFrame.fromDF(truncated_df, glueContext, "tdf"),
    connection_type = "s3", 
    ... )

job.commit()

此操作失败并显示以下错误消息:

AttributeError: 'list' object has no attribute '_jdf'

有什么想法吗?

【问题讨论】:

    标签: python apache-spark dataframe aws-glue


    【解决方案1】:

    尝试单独转换数据,然后在 datasink 中使用动态帧名称

    【讨论】:

      猜你喜欢
      • 2011-08-31
      • 2015-02-04
      • 2012-04-14
      • 2019-02-18
      • 1970-01-01
      • 2022-07-22
      • 1970-01-01
      • 2020-02-07
      • 1970-01-01
      相关资源
      最近更新 更多