

# 从 Pipedrive 实体读取内容
<a name="pipedrive-reading-from-entities"></a>

 **先决条件** 
+  要从中读取内容的 Pipedrive 对象。请参阅下面的支持的实体表，查看可用的实体。

 **支持的实体** 


| 实体 | 可以筛选 | 支持限制 | 支持排序依据 | 支持 Select \$1 | 支持分区 | 
| --- | --- | --- | --- | --- | --- | 
| 活动 | 支持 | 是 | 否 | 是 | 是 | 
| 活动类型 | 否 | 否 | 否 | 是 | 否 | 
| Call Logs | 否 | 否 | 否 | 是 | 否 | 
| Currencies | 支持 | 是 | 否 | 是 | 否 | 
| 交易 | 支持 | 是 | 是 | 是 | 是 | 
| 线索 | 支持 | 是 | 是 | 是 | 否 | 
| Lead Sources | 否 | 是 | 否 | 是 | 否 | 
| Lead Labels | 否 | 否 | 否 | 否 | 否 | 
| 备注 | 支持 | 是 | 是 | 是 | 是 | 
| 组织 | 支持 | 是 | 否 | 是 | 是 | 
| 权限集 | 是 | 否 | 否 | 是 | 否 | 
| 人员 | 支持 | 是 | 是 | 是 | 是 | 
| Pipelines | 否 | 是 | 否 | 是 | 否 | 
| 产品 | 支持 | 是 | 否 | 是 | 是 | 
| 角色 | 否 | 是 | 否 | 是 | 否 | 
| 阶段 | 支持 | 是 | 否 | 是 | 否 | 
| Users | 否 | 否 | 否 | 是 | 否 | 

 **示例** 

```
pipedrive_read= glueContext.create_dynamic_frame.from_options(
    connection_type="PIPEDRIVE",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "activites",
        "API_VERSION": "v1"
    }
```

 **Pipedrive 实体和字段详细信息** 

 实体列表：
+  Activities：[ https://developers.pipedrive.com/docs/api/v1/Activities](https://developers.pipedrive.com/docs/api/v1/Activities) 
+  Activity Type：[https://developers.pipedrive.com/docs/api/v1/ActivityTypes](https://developers.pipedrive.com/docs/api/v1/ActivityTypes) 
+  Call Logs：[https://developers.pipedrive.com/docs/api/v1/CallLogs](https://developers.pipedrive.com/docs/api/v1/CallLogs) 
+  Currencies：[https://developers.pipedrive.com/docs/api/v1/Currencies](https://developers.pipedrive.com/docs/api/v1/Currencies) 
+  Deals：[https://developers.pipedrive.com/docs/api/v1/Deals](https://developers.pipedrive.com/docs/api/v1/Deals) 
+  Leads：[https://developers.pipedrive.com/docs/api/v1/Leads](https://developers.pipedrive.com/docs/api/v1/Leads) 
+  Lead Sources：[https://developers.pipedrive.com/docs/api/v1/LeadSources](https://developers.pipedrive.com/docs/api/v1/LeadSources) 
+  Lead Labels：[https://developers.pipedrive.com/docs/api/v1/LeadLabels](https://developers.pipedrive.com/docs/api/v1/LeadLabels) 
+  Notes：[https://developers.pipedrive.com/docs/api/v1/Notes](https://developers.pipedrive.com/docs/api/v1/Notes) 
+  Organizations：[https://developers.pipedrive.com/docs/api/v1/Organizations](https://developers.pipedrive.com/docs/api/v1/Organizations) 
+  Permission Sets：[ https://developers.pipedrive.com/docs/api/v1/PermissionSets](https://developers.pipedrive.com/docs/api/v1/PermissionSets) 
+  Persons：[https://developers.pipedrive.com/docs/api/v1/Persons](https://developers.pipedrive.com/docs/api/v1/Persons) 
+  Pipelines：[https://developers.pipedrive.com/docs/api/v1/Pipelines](https://developers.pipedrive.com/docs/api/v1/Pipelines) 
+  Products：[https://developers.pipedrive.com/docs/api/v1/Products](https://developers.pipedrive.com/docs/api/v1/Products) 
+  Roles：[https://developers.pipedrive.com/docs/api/v1/Roles](https://developers.pipedrive.com/docs/api/v1/Roles) 
+  Stages：[https://developers.pipedrive.com/docs/api/v1/Stages](https://developers.pipedrive.com/docs/api/v1/Stages) 
+  Users：[https://developers.pipedrive.com/docs/api/v1/Users](https://developers.pipedrive.com/docs/api/v1/Users) 


| 实体 | 数据类型 | 支持的运算符 | 
| --- | --- | --- | 
| Activities、Deals、Notes、Organization、Persons 及 Products。 | 日期 | '=' | 
|  | 整数 | '=' | 
|  | 字符串 | '=' | 
|  | 布尔值 | '=' | 

## 对查询进行分区
<a name="pipedrive-partitioning-queries"></a>

 在 Pipedrive 中，“Activities”实体中只有一个字段（due\$1date）支持基于字段的分区。即“Date”字段。

 如果您想在 Spark 中利用并发，可以提供附加 Spark 选项 `PARTITION_FIELD`、`LOWER_BOUND`、`UPPER_BOUND` 和 `NUM_PARTITIONS`。使用这些参数，原始查询将被拆分为 `NUM_PARTITIONS` 个子查询，这些子查询可以由 Spark 任务同时执行。
+  `PARTITION_FIELD`：用于对查询进行分区的字段的名称。
+  `LOWER_BOUND`：所选分区字段的包含下限值。

   对于日期，我们接受 Spark SQL 查询中使用的 Spark 日期格式。有效值示例：`"2024-02-06"`。
+  `UPPER_BOUND`：所选分区字段的排除上限值。
+  `NUM_PARTITIONS`：分区的数量。

 **示例** 

```
pipedrive_read = glueContext.create_dynamic_frame.from_options(
    connection_type="PIPEDRIVE",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "activites",
        "API_VERSION": "v1",
        "PARTITION_FIELD": "due_date"
        "LOWER_BOUND": "2023-09-07T02:03:00.000Z"
        "UPPER_BOUND": "2024-05-07T02:03:00.000Z"
        "NUM_PARTITIONS": "10"
    }
```