先决条件
要从中读取内容的 PayPal 对象。需要对象名称 transaction
。
源支持的实体:
实体 | 可以筛选 | 支持限制 | 支持排序依据 | 支持 Select * | 支持分区 |
---|---|---|---|---|---|
交易 | 是 | 是 | 否 | 是 | 是 |
示例:
paypal_read = glueContext.create_dynamic_frame.from_options(
connection_type="paypal",
connection_options={
"connectionName": "connectionName",
"ENTITY_NAME": "transaction",
"API_VERSION": "v1",
"INSTANCE_URL": "https://api-m.paypal.com"
}
PayPal 实体和字段详细信息:
具有静态元数据的实体:
实体 | 字段 | 数据类型 | 支持的运算符 |
---|---|---|---|
交易 | transaction_initiation_date | 日期时间 | 介于 |
last_refreshed_datetime | 字符串 | 不适用 | |
payment_instrument_type | 字符串 | = | |
balance_affecting_records_only | 字符串 | = | |
store_id | 字符串 | = | |
terminal_id | 字符串 | = | |
transaction_currency | 字符串 | = | |
transaction_id | 字符串 | 不适用 | |
transaction_status | 字符串 | 不适用 | |
transaction_type | 字符串 | 不适用 | |
transaction_info | 结构体 | 不适用 | |
payer_info | 结构体 | 不适用 | |
shipping_info | 结构体 | 不适用 | |
cart_info | 结构体 | 不适用 | |
store_info | 结构体 | 不适用 | |
auction_info | 结构体 | 不适用 | |
incentive_info | 结构体 | 不适用 |
对查询进行分区
如果您想在 Spark 中利用并发,可以提供其他 Spark 选项:PARTITION_FIELD
、LOWER_BOUND
、UPPER_BOUND
和 NUM_PARTITIONS
。使用这些参数,原始查询将被拆分为 NUM_PARTITIONS
个子查询,这些子查询可以由 Spark 任务同时执行。
PARTITION_FIELD
:用于对查询进行分区的字段的名称。LOWER_BOUND
:所选分区字段的包含下限值。对于“日期时间”字段,我们接受 ISO 格式的值。
有效值示例:
"2024-07-01T00:00:00.000Z"
UPPER_BOUND
:所选分区字段的排除上限值。NUM_PARTITIONS
:分区的数量。
以下字段支持基于实体的分区:
实体名称 | 分区字段 | 数据类型 |
---|---|---|
交易 | transaction_initiation_date | 日期时间 |
示例:
paypal_read = glueContext.create_dynamic_frame.from_options(
connection_type="paypal",
connection_options={
"connectionName": "connectionName",
"ENTITY_NAME": "transaction",
"API_VERSION": "v1",
"PARTITION_FIELD": "transaction_initiation_date"
"LOWER_BOUND": "2024-07-01T00:00:00.000Z"
"UPPER_BOUND": "2024-07-02T00:00:00.000Z"
"NUM_PARTITIONS": "10"
}