

AWS Data Pipeline 不再提供給新客戶。的現有客戶 AWS Data Pipeline 可以繼續正常使用服務。[進一步了解](https://aws.amazon.com/blogs/big-data/migrate-workloads-from-aws-data-pipeline/)

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# DynamoDBExportDataFormat
<a name="dp-object-dynamodbexportdataformat"></a>

將結構描述套用至 DynamoDB 資料表，讓 Hive 查詢可存取。搭配 `HiveCopyActivity` 物件及 `DynamoDBDataNode` 或 `S3DataNode` 輸入和輸出使用 `DynamoDBExportDataFormat`。`DynamoDBExportDataFormat` 具有下列優點：
+ 同時提供 DynamoDB 和 Amazon S3 支援
+ 可讓您在 Hive 查詢中透過特定資料行篩選資料
+ 即使您有稀疏結構描述，也會從 DynamoDB 匯出所有屬性

**注意**  
DynamoDB Boolean (布林) 類型不會映射到 Hive Boolean (布林) 類型。但是，您可以將 DynamoDB 整數值 0 或 1 映射到 Hive Boolean 類型。

## 範例
<a name="dynamodbexportdataformat-example"></a>

以下範例會示範如何使用 `HiveCopyActivity` 和 `DynamoDBExportDataFormat` 來將資料從一個 `DynamoDBDataNode` 複製到另一個，同時根據時間戳記來進行篩選。

```
{
  "objects": [
    {
      "id" : "DataFormat.1",
      "name" : "DataFormat.1",
      "type" : "DynamoDBExportDataFormat",
      "column" : "timeStamp BIGINT"
    },
    {
      "id" : "DataFormat.2",
      "name" : "DataFormat.2",
      "type" : "DynamoDBExportDataFormat"
    },
    {
      "id" : "DynamoDBDataNode.1",
      "name" : "DynamoDBDataNode.1",
      "type" : "DynamoDBDataNode",
      "tableName" : "item_mapped_table_restore_temp",
      "schedule" : { "ref" : "ResourcePeriod" },
      "dataFormat" : { "ref" : "DataFormat.1" }
    },
    {
      "id" : "DynamoDBDataNode.2",
      "name" : "DynamoDBDataNode.2",
      "type" : "DynamoDBDataNode",
      "tableName" : "restore_table",
      "region" : "us_west_1",
      "schedule" : { "ref" : "ResourcePeriod" },
      "dataFormat" : { "ref" : "DataFormat.2" }
    },
    {
      "id" : "EmrCluster.1",
      "name" : "EmrCluster.1",
      "type" : "EmrCluster",
      "schedule" : { "ref" : "ResourcePeriod" },
      "masterInstanceType" : "m1.xlarge",
      "coreInstanceCount" : "4"
    },
    {
      "id" : "HiveTransform.1",
      "name" : "Hive Copy Transform.1",
      "type" : "HiveCopyActivity",
      "input" : { "ref" : "DynamoDBDataNode.1" },
      "output" : { "ref" : "DynamoDBDataNode.2" },
      "schedule" : { "ref" : "ResourcePeriod" },
      "runsOn" : { "ref" : "EmrCluster.1" },
      "filterSql" : "`timeStamp` > unix_timestamp(\"#{@scheduledStartTime}\", \"yyyy-MM-dd'T'HH:mm:ss\")"
    },
    {
      "id" : "ResourcePeriod",
      "name" : "ResourcePeriod",
      "type" : "Schedule",
      "period" : "1 Hour",
      "startDateTime" : "2013-06-04T00:00:00",
      "endDateTime" : "2013-06-04T01:00:00"
    }
  ]
}
```

## 語法
<a name="dynamodbexportdataformat-syntax"></a>


****  

| 選用欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| 欄位 | 針對此資料節點描述的資料，含每個欄位所指定之資料類型的欄位名稱。例如：hostname STRING | String | 
| parent | 目前物件的父系，其插槽會被繼承。 | 參考物件，例如 "parent":\$1"ref":"myBaseObjectId"\$1 | 

 


****  

| 執行時間欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| @version | 建立物件使用的管道版本。 | String | 

 


****  

| 系統欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| @error | 描述格式錯誤物件的錯誤 | String | 
| @pipelineId | 此物件所屬管道的 ID | String | 
| @sphere | 物件範圍代表其在生命週期中的位置：Component 物件會引發執行 Attempt 物件的 Instance 物件 | String | 