

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

**前提条件**

読み取り元の QuickBooks オブジェクト。

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


| エンティティ | フィルタリング可能 | 制限をサポートする | Order By をサポートする | Select \$1 をサポートする | パーティション分割をサポートする | 
| --- | --- | --- | --- | --- | --- | 
| アカウント | はい | あり | あり | あり | あり | 
| 請求 | はい | あり | あり | あり | あり | 
| 会社情報 | なし | なし | なし | あり | なし | 
| お客様 | はい | あり | あり | あり | あり | 
| 従業員 | はい | あり | あり | あり | あり | 
| Estimate | はい | あり | あり | あり | あり | 
| Invoice | はい | あり | あり | あり | あり | 
| Item | はい | あり | あり | あり | あり | 
| Payment | はい | あり | あり | あり | あり | 
| 詳細設定 | なし | なし | なし | あり | なし | 
| 利益と損失 | あり | なし | なし | あり | なし | 
| 税務機関 | はい | あり | あり | あり | あり | 
| ベンダー | はい | あり | あり | あり | あり | 

**例**:

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

**QuickBooks エンティティとフィールドの詳細**:

エンティティとフィールドの詳細については、以下を参照してください:
+ [アカウント](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account)
+ [請求](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)
+ [お客様](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer)
+ [従業員](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)
+ [項目](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)
+ [詳細設定](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)
+ [ベンダー](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor)

## パーティショニングクエリ
<a name="quickbooks-reading-partitioning-queries"></a>

**フィールドベースのパーティション分割**:

QuickBooks では、整数および 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"
    }
```