diff --git a/pkg/resources/stage.go b/pkg/resources/stage.go index 8dbb0c0806..884ca76d79 100644 --- a/pkg/resources/stage.go +++ b/pkg/resources/stage.go @@ -50,9 +50,10 @@ var stageSchema = map[string]*schema.Schema{ Description: "Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.", }, "file_format": { - Type: schema.TypeString, - Optional: true, - Description: "Specifies the file format for the stage.", + Type: schema.TypeString, + Optional: true, + Description: "Specifies the file format for the stage.", + DiffSuppressFunc: suppressQuoting, }, "copy_options": { Type: schema.TypeString, diff --git a/pkg/resources/stage_acceptance_test.go b/pkg/resources/stage_acceptance_test.go index c6f97e53f2..58ac1ff4b8 100644 --- a/pkg/resources/stage_acceptance_test.go +++ b/pkg/resources/stage_acceptance_test.go @@ -64,6 +64,7 @@ func TestAcc_Stage_CreateAndAlter(t *testing.T) { changedStorageIntegration := ids.PrecreatedS3StorageIntegration changedEncryption := "TYPE = 'AWS_SSE_S3'" changedFileFormat := "TYPE = JSON NULL_IF = []" + changedFileFormatWithQuotes := "FIELD_DELIMITER = '|' PARSE_HEADER = true" changedComment := random.Comment() copyOptionsWithoutQuotes := "ON_ERROR = CONTINUE" @@ -129,6 +130,25 @@ func TestAcc_Stage_CreateAndAlter(t *testing.T) { PostApplyPreRefresh: []plancheck.PlanCheck{plancheck.ExpectEmptyPlan()}, }, }, + { + ConfigDirectory: config.TestNameDirectory(), + ConfigVariables: configVariables(changedUrl, changedStorageIntegration.Name(), credentials, changedEncryption, changedFileFormatWithQuotes, changedComment, copyOptionsWithoutQuotes), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "database", databaseName), + resource.TestCheckResourceAttr(resourceName, "schema", schemaName), + resource.TestCheckResourceAttr(resourceName, "name", name), + resource.TestCheckResourceAttr(resourceName, "storage_integration", changedStorageIntegration.Name()), + resource.TestCheckResourceAttr(resourceName, "credentials", credentials), + resource.TestCheckResourceAttr(resourceName, "encryption", changedEncryption), + resource.TestCheckResourceAttr(resourceName, "file_format", changedFileFormatWithQuotes), + resource.TestCheckResourceAttr(resourceName, "copy_options", copyOptionsWithoutQuotes), + resource.TestCheckResourceAttr(resourceName, "url", changedUrl), + resource.TestCheckResourceAttr(resourceName, "comment", changedComment), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PostApplyPreRefresh: []plancheck.PlanCheck{plancheck.ExpectEmptyPlan()}, + }, + }, { ConfigDirectory: config.TestNameDirectory(), ConfigVariables: configVariables(changedUrl, changedStorageIntegration.Name(), credentials, changedEncryption, changedFileFormat, changedComment, copyOptionsWithoutQuotes),