Skip to content

Commit

Permalink
Merge pull request #16727 from gmazelier/r/glue_catalog_table_empty_p…
Browse files Browse the repository at this point in the history
…artition_keys

Glue catalog table empty partition keys
  • Loading branch information
breathingdust authored Jan 5, 2021
2 parents 471208d + 159b09f commit 94ab63a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aws/resource_aws_glue_catalog_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ func expandGlueTableInput(d *schema.ResourceData) *glue.TableInput {

if v, ok := d.GetOk("partition_keys"); ok {
tableInput.PartitionKeys = expandGlueColumns(v.([]interface{}))
} else {
tableInput.PartitionKeys = []*glue.Column{}
}

if v, ok := d.GetOk("view_original_text"); ok {
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_glue_catalog_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestAccAWSGlueCatalogTable_basic(t *testing.T) {
testAccCheckResourceAttrRegionalARN(resourceName, "arn", "glue", fmt.Sprintf("table/%s/%s", rName, rName)),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttr(resourceName, "database_name", rName),
resource.TestCheckResourceAttr(resourceName, "partition_keys.#", "0"),
testAccCheckResourceAttrAccountID(resourceName, "catalog_id"),
),
},
Expand Down

0 comments on commit 94ab63a

Please sign in to comment.