2017-03-28 6 views
0

30個のカラムを持つテーブルにGSIを作成しようとしています(ruby SDKを使用)。 「ALL」 - 私はまだ、次の例外を取得::私はprojection_typeを使用グローバルセカンダリインデックス:すべてのインデックスの投影される属性の数が制限を超えています。

Aws::DynamoDB::Errors::ValidationException: One or more parameter values were invalid: Number of projected attributes in all indexes exceeds limit of 20, number of projected attributes:30 

INCLUDE projection_typeを使用するときに限り、私は読んで、これはのみ発生する必要があります

この制限はありませんProjectionTypeがKEYS_ONLYまたはALLの2次索引を適用します。 http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html#limits-secondary-indexes

create文のようなものになります:属性制限制限はテーブルの上にすべてのGSIの間で行くことが判明し

connection.update_table({ 
    table_name: "my-table", # required 
    attribute_definitions: [ 
     { 
     attribute_name: "indexDate", 
     attribute_type: "S", 
     }, 
     { 
     attribute_name: "createdAt", 
     attribute_type: "S", 
     }, 
    ], 
    global_secondary_index_updates: [ 
     { 
     create: { 
      index_name: "my-new-index", # required 
      key_schema: [ 
      { 
       attribute_name: "indexDate", 
       key_type: "HASH", 
      }, 
      { 
       attribute_name: "createdAt", 
       key_type: "RANGE", 
      }, 
      ], 
      projection: { # required 
      projection_type: "ALL" 
      }, 
      provisioned_throughput: { # required 
      read_capacity_units: 10, # required 
      write_capacity_units: 300, # required 
      } 
     } 
     } 
    ] 
    }) 
+0

このテーブルにはいくつのGSIがありますか?おそらく、他のGSIのProjectionTypeがINCLUDEであり、20の属性を超えている可能性があります。 describe tableコマンドを実行してその結果を投稿に含めてください。 – notionquest

+0

あなたは正しいです。それは別のGSIによるものだった –

答えて

0

を。私はこれを失敗させる別のものがあった。その1つを削除し、それが働いた。

関連する問題