從 Salesforce Marketing Cloud 實體中讀取 - AWS Glue

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

從 Salesforce Marketing Cloud 實體中讀取

必要條件

您想要從中讀取的 Salesforce Marketing Cloud 物件。您將需要物件名稱,例如 ActivityCampaigns。下表顯示支援的實體。

來源的支援實體

實體 介面 可以篩選 支援限制 支援排序依據 支援 SELECT * 支援分區
事件通知回呼 REST
Seed-List REST
設定 REST
網域驗證 REST
物件巢狀標籤 REST
聯絡 REST
事件通知訂閱 REST
簡訊 REST
活動 SOAP
Bounce Event SOAP
Click Event SOAP
Content Area SOAP
Data Extension SOAP
電子郵件 SOAP
Forwarded Email Event SOAP
Forward Email OptInEvent SOAP
連結 SOAP
Link Send SOAP
清單 SOAP
List Subscriber SOAP
Not Sent Event SOAP
Open Event SOAP
傳送 SOAP
Sent Event SOAP
Subscriber SOAP
Survey Event SOAP
Unsub Event SOAP
稽核事件 REST
行銷活動 REST
互動 REST
內容資產 REST

REST 的範例

salesforcemarketingcloud_read = glueContext.create_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "Campaigns", "API_VERSION": "v1", "INSTANCE_URL": "https://**********************.rest.marketingcloudapis.com" } )

SOAP 的範例

salesforcemarketingcloud_read = glueContext.create_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "Activity", "API_VERSION": "v1", "INSTANCE_URL": "https://**********************.soap.marketingcloudapis.com" } )

Salesforce Marketing Cloud 實體和欄位詳細資訊

下表說明 Salesforce Marketing Cloud 實體。存在具有靜態中繼資料的 REST 實體和具有動態中繼資料的 SOAP 實體。

具有靜態中繼資料的 REST 實體

實體 欄位 資料類型 支援的運算子
事件通知回呼 callbackId String
callbackName String
url String
maxBatchSize Integer
status String
statusReason String
Seed-List id String
name String
描述 String
activeSeedCount Integer
設定 customerKey String
name String
描述 String
locationType String '='
awsFileTransferLocation Struct
網域驗證 enterpriseId Integer
status String '='
domainType String '='
memberId Integer
emailSendTime DateTime
domain String
isSendable Boolean
物件巢狀標籤 id Integer
modifiedDate DateTime
標籤 清單
name String
描述 String
parentId Integer
聯絡 values 清單
事件通知訂閱 subscriptionName String
callbackId String
callbackName String
eventCategoryTypes 清單
篩選條件 清單
url String
maxBatchSize Integer
subscriptionId String
status String
statusReason String
簡訊 deliveryTime DateTime
id String
messageId String
status String
Struct
互動 status String '='
id String
金鑰 String
name String
lastPublishedDate DateTime
描述 String
version Integer
workflowApiVersion Integer
createdDate DateTime
modifiedDate DateTime
goals Struct
統計資料 Struct
entryMode String
預設值 Struct
executionMode Struct
definitionId String
內容資產 id Integer
customerKey String
objectId String
ContentType String
assetType Struct
name String
描述 String
owner Struct
createdDate DateTime
createdBy Struct
modifiedDate DateTime
modifiedBy Struct
thumbnail Struct
category Struct
meta Struct
檢視 Struct
availableViews Struct
資料 Struct
legacyData Struct
modelVersion Integer
版本 Integer
Locked (已鎖定) Boolean
FileProperties Struct
Tags (標籤) 清單
內容 String
設計 String
SuperContent String
CustomFields Struct
區塊 Struct
MinBlocks Integer
MaxBlocks Integer
頻道 Struct
AllowedBlocks 清單
Struct
BusinessUnitAvailability Struct
sharingProperties Struct
sharingProperties.sharedWith Struct
sharingProperties.sharingType String
範本 Struct
檔案 String
GenerateFrom String
稽核事件 id Integer
createdDate DateTime
memberId Integer
enterpriseId Integer
employee Struct
objectType Struct
operation Struct
object Struct
transactionId String
行銷活動 id Integer
createdDate DateTime
modifiedDate DateTime
name String
描述 String
campaignCode String
color String
favorite Boolean

具有動態中繼資料的 SOAP 實體

實體 資料類型 支援的運算子
活動 String LIKE,!=,=
Struct
Integer !=,=,>=,<=,<,>
Double !=,=,>=,<=,<,>
Boolean !=,=
DateTime >=,<=,<,>,=,BETWEEN
Bounce Event Integer !=,=,>=,<=,<,>
DateTime >=,<=,<,>,=,BETWEEN
String LIKE,!=,=
Struct
Click Event Integer !=,=,>=,<=,<,>
DateTime >=,<=,<,>,=,BETWEEN
String LIKE,!=,=
Struct
Content Area Struct
String LIKE,!=,=
Integer !=,=,>=,<=,<,>
DateTime >=,<=,<,>,=,BETWEEN
Boolean !=,=
Data Extension DateTime >=,<=,<,>,=,BETWEEN
String LIKE,!=,=
電子郵件 Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Boolean !=,=
Struct
Forwarded Email Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Forwarded Email OptInEvent Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
連結 Integer !=,=,>=,<=,<,>
Link Send Integer !=,=,>=,<=,<,>
String LIKE,!=,=
Double !=,=,>=,<=,<,>
清單 Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
List Subscriber Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Not Sent Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Open Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
傳送 Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Boolean !=,=
Struct
Sent Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Subscriber Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Survey Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Struct
Unsub Event Integer !=,=,>=,<=,<,>
String LIKE,!=,=
DateTime >=,<=,<,>,=,BETWEEN
Boolean !=,=
Struct

分區查詢

在 Salesforce Marketing Cloud 中,Integer 和 DateTime 資料類型欄位支援欄位型分區。

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

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

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

    對於時間戳記欄位,接受 Spark SQL 查詢中使用的 Spark 時間戳記格式。

    有效值的範例:

    “2024-05-07T02:03:00.00Z"
  • UPPER_BOUND:所選分區欄位的唯一上限值。

  • NUM_PARTITIONS:分區數目。

範例:

salesforcemarketingcloud_read = glueContext.create_dynamic_frame.from_options( connection_type="salesforcemarketingcloud", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "ListSubscriber", "API_VERSION": "v1", "PARTITION_FIELD": "CreatedDate", "LOWER_BOUND": "2023-09-07T02:03:00.000Z", "UPPER_BOUND": "2024-05-07T02:03:00.000Z", "NUM_PARTITIONS": "10" } )