aws glue刚刚从dynamodb读取了选定的记录

6ioyuze2  于 2021-07-14  发布在  Spark
关注(0)|答案(0)|浏览(248)

下面的代码正在读取完整的dynamo db表。有没有办法,我们可以读取选定的行(给定一组分区列的有限值)

import sys
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from awsglue.utils import getResolvedOptions

args = getResolvedOptions(sys.argv, ["JOB_NAME"])
glue_context= GlueContext(SparkContext.getOrCreate())
job = Job(glue_context)
job.init(args["JOB_NAME"], args)

dyf = glue_context.create_dynamic_frame.from_options(
    connection_type="dynamodb",
    connection_options={
        "dynamodb.input.tableName": "test_source",
        "dynamodb.throughput.read.percent": "1.0",
        "dynamodb.splits": "100"
    }
)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题