從 PayPal 實體中讀取 - AWS Glue

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

從 PayPal 實體中讀取

必要條件

您要從中讀取的 PayPal 物件。將需要物件名稱,transaction

來源的支援實體

實體 可以篩選 支援限制 支援排序依據 支援選取 * 支援分區
transaction

範例

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 transaction_initiation_date DateTime 之間
last_refreshed_datetime String N/A
payment_instrument_type String =
balance_affecting_records_only String =
store_id String =
terminal_id String =
transaction_currency String =
transaction_id String N/A
transaction_status String N/A
transaction_type String N/A
transaction_info Struct N/A
payer_info Struct N/A
shipping_info Struct N/A
cart_info Struct N/A
store_info Struct N/A
auction_info Struct N/A
incentive_info Struct N/A

分區查詢

如果想要在 Spark 中使用並行,可以提供其他 Spark 選項 PARTITION_FIELDLOWER_BOUNDUPPER_BOUNDNUM_PARTITIONS。使用這些參數,原始查詢會分區為可由 Spark 任務並行執行的子查詢的 NUM_PARTITIONS 數目。

  • PARTITION_FIELD:用來分區查詢的欄位名稱。

  • LOWER_BOUND:所選分區欄位的包含下限值。

    對於 Datetime 欄位,接受 ISO 格式的值。

    有效值的範例:

    "2024-07-01T00:00:00.000Z"
  • UPPER_BOUND:所選分區欄位的唯一上限值。

  • NUM_PARTITIONS:分區數目。

實體分區支援下列欄位:

實體名稱 分區欄位 資料類型
transaction transaction_initiation_date DateTime

範例:

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" }