

# WooCommerce 엔터티에서 읽기
<a name="woocommerce-reading-from-entities"></a>

**사전 조건**

읽으려는 WooCommerce 객체입니다. 쿠폰, 주문, 제품 등과 같은 객체 이름이 필요합니다.

**소스에 대해 지원되는 엔터티**:


| 개체 | 필터링 가능 | 제한 지원 | 정렬 기준 지원 | Select \$1 지원 | 분할 지원 | 
| --- | --- | --- | --- | --- | --- | 
| Coupon | 예 | 예 | 예 | 예 | 예 | 
| Coupon Total | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Customers Total | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Order | 예 | 예 | 예 | 예 | 예 | 
| Orders Total | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Payment Gateway | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Product | 예 | 예 | 예 | 예 | 예 | 
| Product attribute | 예 | 예 | 예 | 예 | 예 | 
| Product category | 예 | 예 | 예 | 예 | 예 | 
| Product review | 예 | 예 | 예 | 예 | 예 | 
| Product shipping class | 예 | 예 | 예 | 예 | 예 | 
| Product tag | 예 | 예 | 예 | 예 | 예 | 
| Product variation | 예 | 예 | 예 | 예 | 예 | 
| Products Total | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Report (List) | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Reviews Total | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Sales Report | 예 | 아니요 | 아니요 | 예 | 아니요 | 
| Shipping Method | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Shipping Zone | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Shipping Zone Location | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Shipping Zone Method | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Tax Rate | 예 | 예 | 예 | 예 | 예 | 
| Tax Class | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Top Sellers Report | 예 | 아니요 | 아니요 | 예 | 아니요 | 

**예시:**

```
woocommerce_read = glueContext.create_dynamic_frame.from_options(
    connection_type="glue.spark.woocommerce",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupon",
        "API_VERSION": "v3",
        "INSTANCE_URL": "instanceUrl"
    }
```

**WooCommerce 엔터티 및 필드 세부 정보**:

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

**참고**  
커넥터의 응답에서 Struct 및 List 데이터 유형은 String 데이터 유형으로 변환되며, DateTime 데이터 유형은 타임스탬프로 변환됩니다.

## 분할 쿼리
<a name="woocommerce-reading-partitioning-queries"></a>

**레코드 기반 분할**:

Spark에서 동시성을 활용하려는 경우 추가 Spark 옵션(`NUM_PARTITIONS`)을 제공할 수 있습니다. 이러한 파라미터를 사용하면 Spark 작업에서 동시에 실행할 수 있는 `NUM_PARTITIONS`개의 하위 쿼리로 원래 쿼리가 분할됩니다.

레코드 기반 분할에서는 존재하는 총 레코드 수를 WooCommerce API에서 쿼리하고 제공된 `NUM_PARTITIONS` 번호로 나눕니다. 그런 다음, 결과 레코드 수를 각 하위 쿼리에서 동시에 가져옵니다.
+ `NUM_PARTITIONS`: 파티션 수.

다음 엔터티는 레코드 기반 분할을 지원합니다.
+ coupon
+ 순서
+ product
+ product-attribute
+ product-attribute-term
+ product-category
+ product-review
+ product-shipping-class
+ product-tag
+ product-variation
+ tax-rate

예시:

```
woocommerce_read = glueContext.create_dynamic_frame.from_options(
    connection_type="glue.spark.woocommerce",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupon",
        "API_VERSION": "v3",
        "INSTANCE_URL": "instanceUrl"
        "NUM_PARTITIONS": "10"
    }
```

**레코드 기반 분할**:

원본 쿼리가 Spark 태스크에서 동시에 실행할 수 있는 `NUM_PARTITIONS`개의 하위 쿼리로 분할됩니다.
+ `NUM_PARTITIONS`: 파티션 수.

예시:

```
WooCommerce_read = glueContext.create_dynamic_frame.from_options(
    connection_type="WooCommerce",
    connection_options={
        "connectionName": "connectionName",
        "REALMID": "1234567890123456789",
        "ENTITY_NAME": "Bill",
        "API_VERSION": "v3",
        "NUM_PARTITIONS": "10"
    }
```