diff --git a/aws/resource_aws_glue_catalog_table.go b/aws/resource_aws_glue_catalog_table.go index 527f16ba141..122581d4429 100644 --- a/aws/resource_aws_glue_catalog_table.go +++ b/aws/resource_aws_glue_catalog_table.go @@ -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 { diff --git a/aws/resource_aws_glue_catalog_table_test.go b/aws/resource_aws_glue_catalog_table_test.go index c44144e9f52..8f575fe2b74 100644 --- a/aws/resource_aws_glue_catalog_table_test.go +++ b/aws/resource_aws_glue_catalog_table_test.go @@ -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"), ), },