

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

**사전 조건**

읽으려는 QuickBooks 객체입니다.

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


| 개체 | 필터링 가능 | 제한 지원 | 정렬 기준 지원 | Select \$1 지원 | 분할 지원 | 
| --- | --- | --- | --- | --- | --- | 
| Account | 예 | 예 | 예 | 예 | 예 | 
| Bill | 예 | 예 | 예 | 예 | 예 | 
| Company Info | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Customer | 예 | 예 | 예 | 예 | 예 | 
| Employee | 예 | 예 | 예 | 예 | 예 | 
| Estimate | 예 | 예 | 예 | 예 | 예 | 
| Invoice | 예 | 예 | 예 | 예 | 예 | 
| Item | 예 | 예 | 예 | 예 | 예 | 
| Payment | 예 | 예 | 예 | 예 | 예 | 
| Preferences | 아니요 | 아니요 | 아니요 | 예 | 아니요 | 
| Profit and Loss | 예 | 아니요 | 아니요 | 예 | 아니요 | 
| Tax Agency | 예 | 예 | 예 | 예 | 예 | 
| Vendors | 예 | 예 | 예 | 예 | 예 | 

**예시:**

```
QuickBooks_read = glueContext.create_dynamic_frame.from_options(
    connection_type="quickbooks",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "Account",
        "API_VERSION": "v3"
    }
```

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

엔터티 및 필드 세부 정보에 대한 자세한 내용은 다음을 참조하세요.
+ [Account](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account)
+ [Bill](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/bill)
+ [CompanyInfo](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/companyinfo)
+ [Customer](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer)
+ [Employee](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee)
+ [Estimate](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/estimate)
+ [Invoice](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/invoice)
+ [Item](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item)
+ [Payment](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/payment)
+ [Preferences](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/preferences)
+ [ProfitAndLoss](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/profitandloss)
+ [TaxAgency](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/taxagency)
+ [Vendor](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor)

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

**필드 기반 분할**:

QuickBooks에서 Integer 및 DateTime 데이터 유형 필드는 필드 기반 분할을 지원합니다.

Spark에서 동시성을 활용하려는 경우 추가 Spark 옵션(`PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS`)을 제공할 수 있습니다. 이러한 파라미터를 사용하면 Spark 작업에서 동시에 실행할 수 있는 `NUM_PARTITIONS`개의 하위 쿼리로 원래 쿼리가 분할됩니다.
+ `PARTITION_FIELD`: 쿼리 분할에 사용할 필드의 이름입니다.
+ `LOWER_BOUND`: 선택한 파티션 필드의 하한 값(**경계 포함**).

  Datetime 필드의 경우 Spark SQL 쿼리에 사용된 Spark 타임스탬프 형식을 허용합니다.

  유효한 값의 예제:

  ```
  "2024-05-07T02:03:00.00Z"
  ```
+ `UPPER_BOUND`: 선택한 파티션 필드의 상한 값(**경계 제외**).
+ `NUM_PARTITIONS`: 파티션 수.

예시:

```
QuickBooks_read = glueContext.create_dynamic_frame.from_options(
    connection_type="quickbooks",
    connection_options={
        "connectionName": "connectionName",
        "REALMID": "12345678690123456789",
        "ENTITY_NAME": "Account",
        "API_VERSION": "v3",
        "PARTITION_FIELD": "MetaData_CreateTime"
        "LOWER_BOUND": "2023-09-07T02:03:00.000Z"
        "UPPER_BOUND": "2024-05-07T02:03:00.000Z"
        "NUM_PARTITIONS": "10"
    }
```

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

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

예시:

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