

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

 **先决条件** 

要从中读取内容的 Pendo 对象。请参阅下面的支持的实体表，查看可用的实体。

 **支持的实体** 
+ [功能](https://developers.pendo.io/docs/?bash#feature)
+ [Guide](https://developers.pendo.io/docs/?bash#guide)
+ [页面](https://developers.pendo.io/docs/?bash#page)
+ [报告](https://developers.pendo.io/docs/?bash#report)
+ [Report Data](https://developers.pendo.io/docs/?bash#return-report-contents-as-array-of-json-objects)
+ [Visitor](https://developers.pendo.io/docs/?bash#visitor)
+ [Account](https://developers.pendo.io/docs/?bash#entities)
+ [Event (事件)](https://developers.pendo.io/docs/?bash#events-grouped)
+ [Feature Event](https://developers.pendo.io/docs/?bash#events-grouped)
+ [Guide Event](https://developers.pendo.io/docs/?bash#events-ungrouped)
+ [Page Event](https://developers.pendo.io/docs/?bash#events-grouped)
+ [Poll Event](https://developers.pendo.io/docs/?bash#events-ungrouped)
+ [Track Event](https://developers.pendo.io/docs/?bash#events-grouped)


| 实体 | 可以筛选 | 支持限制 | 支持排序依据 | 支持 Select \$1 | 支持分区 | 
| --- | --- | --- | --- | --- | --- | 
| 功能 | 否 | 否 | 否 | 是 | 否 | 
| Guide | 否 | 否 | 否 | 是 | 否 | 
| 页面 | 否 | 否 | 否 | 是 | 否 | 
| 报告 | 否 | 否 | 否 | 是 | 否 | 
| Report Data | 否 | 否 | 否 | 是 | 否 | 
| Visitor（Aggregation API） | 是 | 否 | 是 | 是 | 否 | 
| Account（Aggregation API） | 是 | 否 | 是 | 是 | 否 | 
| Event（Aggregation API） | 是 | 否 | 是 | 是 | 否 | 
| Feature Event（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 
| Guide Event（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 
| Account（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 
| Page Event（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 
| Poll Event（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 
| Track Event（Aggregation API） | 是 | 否 | 是 | 是 | 是 | 

 **示例** 

```
Pendo_read = glueContext.create_dynamic_frame.from_options(
    connection_type="glue.spark.Pendo",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "feature",
        "API_VERSION": "v1",
        "INSTANCE_URL": "instanceUrl"
    }
```

## 对查询进行分区
<a name="adobe-marketo-engage-reading-partitioning-queries"></a>

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

  对于日期时间字段，我们接受 ISO 格式的值。

  有效值示例：

  ```
  "2024-07-01T00:00:00.000Z"
  ```
+ `UPPER_BOUND`：所选分区字段的**排除**上限值。
+ `NUM_PARTITIONS`：分区的数量。

下表描述实体分区字段支持详细信息：


| 实体名称 | 
| --- | 
| 事件 | 
|  Feature Event  | 
| Guide Event | 
| Page Event | 
| Poll Event | 
| Track Event | 

示例：

```
pendo_read = glueContext.create_dynamic_frame.from_options(
    connection_type="glue.spark.pendo",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "event",
        "API_VERSION": "v1",
        "INSTANCE_URL": "instanceUrl"
        "NUM_PARTITIONS": "10",
        "PARTITION_FIELD": "appId"
        "LOWER_BOUND": "4656"
        "UPPER_BOUND": "7788"
    }
```