

# Mailchimp エンティティからの読み取り
<a name="mailchimp-reading-from-entities"></a>

 **前提条件** 

読み取り元の Mailchimp オブジェクト。使用可能なエンティティを確認するには、以下のサポートされているエンティティの表を参照してください。

 **サポートされているエンティティ** 
+ [Abuse-reports ](https://mailchimp.com/developer/marketing/api/campaign-abuse/)
+ [オートメーション](https://mailchimp.com/developer/marketing/api/automation/list-automations/)
+ [キャンペーン](https://mailchimp.com/developer/marketing/api/campaigns/list-campaigns/)
+ [Click-details](https://mailchimp.com/developer/marketing/api/link-clickers/)
+ [Lists](https://mailchimp.com/developer/marketing/api/link-clickers/)
+ [メンバー](https://mailchimp.com/developer/marketing/api/list-segment-members/)
+ [Open-details](https://mailchimp.com/developer/marketing/api/list-members/)
+ [セグメント](https://mailchimp.com/developer/marketing/api/list-segments/)
+ [Stores](https://mailchimp.com/developer/marketing/api/ecommerce-stores/list-stores/)
+ [Unsubscribed](https://mailchimp.com/developer/marketing/api/unsub-reports/)


| エンティティ | フィルタリング可能 | 制限をサポートする | Order By をサポートする | Select \$1 をサポートする | パーティショニングをサポートする | 
| --- | --- | --- | --- | --- | --- | 
| オートメーション | あり | はい | はい | はい | はい | 
| キャンペーン | いいえ | なし | なし | なし | いいえ | 
| Lists | あり | あり | なし | はい | はい | 
| Reports Abuse | いいえ | あり | なし | はい | はい | 
| Reports Open | いいえ | あり | なし | はい | はい | 
| Reports Click | あり | あり | なし | はい | はい | 
| Reports Unsubscribe | いいえ | あり | なし | はい | はい | 
| Segment | いいえ | あり | なし | はい | はい | 
| Segment Members | あり | あり | なし | あり | なし | 
| Stores | あり | はい | はい | あり | なし | 

 **例** 

```
mailchimp_read = glueContext.create_dynamic_frame.from_options(                    
            connection_type="mailchimp",                                           
            connection_options={                                                        
                  "connectionName": "connectionName",                                   
                  "ENTITY_NAME": "stores",  
"INSTANCE_URL": "https://us14.api.mailchimp.com",                     
                  "API_VERSION": "3.0"                                                
               })
```

 **Mailchimp エンティティとフィールドの詳細** 
+ [Abuse-reports ](https://mailchimp.com/developer/marketing/api/campaign-abuse/)
+ [オートメーション](https://mailchimp.com/developer/marketing/api/automation/list-automations/)
+ [キャンペーン](https://mailchimp.com/developer/marketing/api/campaigns/list-campaigns/)
+ [Click-details](https://mailchimp.com/developer/marketing/api/link-clickers/)
+ [Lists](https://mailchimp.com/developer/marketing/api/link-clickers/)
+ [メンバー](https://mailchimp.com/developer/marketing/api/list-segment-members/)
+ [Open-details](https://mailchimp.com/developer/marketing/api/list-members/)
+ [セグメント](https://mailchimp.com/developer/marketing/api/list-segments/)
+ [Stores](https://mailchimp.com/developer/marketing/api/ecommerce-stores/list-stores/)
+ [Unsubscribed](https://mailchimp.com/developer/marketing/api/unsub-reports/)

## パーティショニングクエリ
<a name="mailchimp-engage-reading-partitioning-queries"></a>

Spark で同時実行を使用する場合は、追加の Spark オプション `PARTITION_FIELD`、`LOWER_BOUND`、`UPPER_BOUND`、および `NUM_PARTITIONS` を指定できます。これらのパラメータを使用すると、元のクエリは Spark タスクで同時に実行できるサブクエリの `NUM_PARTITIONS` の数に分割されます。
+ `PARTITION_FIELD`: クエリのパーティション化に使用するフィールドの名前。
+ `LOWER_BOUND`: 選択したパーティションフィールドの**包括的な**下限値。

  DateTime フィールドでは、ISO 形式の値を受け入れます。

  有効な値の例:

  ```
  "2024-07-01T00:00:00.000Z"
  ```
+ `UPPER_BOUND`: 選択したパーティションフィールドの**排他的**上限値。
+ `NUM_PARTITIONS`: パーティション数。

次の表に、エンティティパーティション分割フィールドのサポートの詳細を示します:

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/mailchimp-reading-from-entities.html)

例:

```
read_read = glueContext.create_dynamic_frame.from_options(
    connection_type="mailchimp",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "automations",
        "API_VERSION": "3.0",
        "INSTANCE_URL": "https://us14.api.mailchimp.com",
        "PARTITION_FIELD": "create_time",
        "LOWER_BOUND": "2024-02-05T14:09:30.115Z",
        "UPPER_BOUND": "2024-06-07T13:30:00.134Z",
        "NUM_PARTITIONS": "3"
    }
```