

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

 **前提条件** 

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

 **ソースに対応するエンティティ** 


| エンティティ | フィルタリング可能 | 制限をサポートする | Order By をサポートする | Select \$1 をサポートする | パーティショニングをサポートする | 
| --- | --- | --- | --- | --- | --- | 
|  ワークスペース  | いいえ | あり | なし | あり | なし | 
| タグ | いいえ | あり | なし | あり | なし | 
| ユーザー | いいえ | あり | なし | あり | なし | 
|  ポートフォリオ  | いいえ | あり | なし | あり | なし | 
| チーム | いいえ | あり | なし | あり | なし | 
| プロジェクト | はい | あり | なし | あり | なし | 
| セクション | いいえ | あり | なし | あり | なし | 
| タスク  | はい | なし | なし | はい | はい | 
| 目標 | あり | あり | なし | あり | なし | 
|  AuditLogEvent  | あり | あり | なし | あり | なし | 
|  ステータスの更新  | あり | あり | なし | あり | なし | 
|  カスタムフィールド  | いいえ | あり | なし | あり | なし | 
|  プロジェクトの概要  | はい | なし | なし | はい | はい | 

 **例** 

```
read_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Asana",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "task/workspace:xxxx",
        "API_VERSION": "1.0",
        "PARTITION_FIELD": "created_at",
        "LOWER_BOUND": "2024-02-05T14:09:30.115Z",
        "UPPER_BOUND": "2024-06-07T13:30:00.134Z",
        "NUM_PARTITIONS": "3"
    }
```

 **Asana エンティティとフィールドの詳細** 
+ [ワークスペース](https://developers.asana.com/docs/workspaces)
+ [タグ](https://developers.asana.com/docs/tags):
+ [ユーザー](https://developers.asana.com/docs/users)
+ [ポートフォリオ](https://developers.asana.com/docs/portfolios)
+ [チーム](https://developers.asana.com/docs/teams)
+ [プロジェクト](https://developers.asana.com/docs/get-all-projects-in-a-workspace)
+ [セクション](https://developers.asana.com/docs/get-sections-in-a-project)
+ [タスク](https://developers.asana.com/docs/search-tasks-in-a-workspace) 
+ [目標](https://developers.asana.com/docs/get-goals)
+ [AuditLogEvent](https://developers.asana.com/docs/audit-log-api)
+ [ステータスの更新](https://developers.asana.com/reference/status-updates)
+ [カスタムフィールド](https://developers.asana.com/reference/custom-fields)
+ [プロジェクトの概要](https://developers.asana.com/reference/project-briefs)

 **パーティショニングクエリ** 

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

  日付については、Spark SQL クエリで使用される Spark の日付形式を受け入れます。有効な値の例: `2024-06-07T13:30:00.134Z`。
+ `UPPER_BOUND`: 選択したパーティションフィールドの排他的上限値。
+ `NUM_PARTITIONS`: パーティション数。

 エンティティごとのパーティション分割フィールドのサポートの詳細は、次の表にまとめられています。


| エンティティ名 | Partitioning Field | データタイプ | 
| --- | --- | --- | 
| タスク |  created\$1at  | DateTime | 
| タスク |  modified\$1at  | DateTime | 

 **例** 

```
read_read = glueContext.create_dynamic_frame.from_options(
    connection_type="Asana",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "task/workspace:xxxx",
        "API_VERSION": "1.0",
        "PARTITION_FIELD": "created_at",
        "LOWER_BOUND": "2024-02-05T14:09:30.115Z",
        "UPPER_BOUND": "2024-06-07T13:30:00.134Z",
        "NUM_PARTITIONS": "3"
    }
```