Skip to content

Commit

Permalink
r/aws_glue_crawler: 'delta_target.create_native_delta_table' is Optio…
Browse files Browse the repository at this point in the history
…nal.
  • Loading branch information
ewbankkit committed Mar 10, 2023
1 parent ac1afef commit ea18850
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/service/glue/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func ResourceCrawler() *schema.Resource {
},
"create_native_delta_table": {
Type: schema.TypeBool,
Required: true,
Optional: true,
},
"delta_tables": {
Type: schema.TypeSet,
Expand Down
12 changes: 6 additions & 6 deletions internal/service/glue/crawler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,12 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) {
CheckDestroy: testAccCheckCrawlerDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table1"),
Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table1", "null"),
Check: resource.ComposeTestCheckFunc(
testAccCheckCrawlerExists(ctx, resourceName, &crawler),
resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"),
resource.TestCheckResourceAttr(resourceName, "delta_target.0.connection_name", rName),
resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "true"),
resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"),
resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"),
resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table1"),
resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"),
Expand All @@ -545,7 +545,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) {
ImportStateVerify: true,
},
{
Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table2"),
Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table2", "true"),
Check: resource.ComposeTestCheckFunc(
testAccCheckCrawlerExists(ctx, resourceName, &crawler),
resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"),
Expand Down Expand Up @@ -2933,7 +2933,7 @@ resource "aws_glue_crawler" "test" {
`, rName, connectionUrl, path1, path2))
}

func testAccCrawlerConfig_deltaTarget(rName, connectionUrl, tableName string) string {
func testAccCrawlerConfig_deltaTarget(rName, connectionUrl, tableName, createNativeDeltaTable string) string {
return acctest.ConfigCompose(testAccCrawlerConfig_base(rName), fmt.Sprintf(`
resource "aws_glue_catalog_database" "test" {
name = %[1]q
Expand Down Expand Up @@ -2961,10 +2961,10 @@ resource "aws_glue_crawler" "test" {
connection_name = aws_glue_connection.test.name
delta_tables = [%[3]q]
write_manifest = false
create_native_delta_table = true
create_native_delta_table = %[4]s
}
}
`, rName, connectionUrl, tableName))
`, rName, connectionUrl, tableName, createNativeDeltaTable))
}

func testAccCrawlerConfig_lakeformation(rName string, use bool) string {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/glue_crawler.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ The following arguments are supported:
### Delta Target

* `connection_name` - (Optional) The name of the connection to use to connect to the Delta table target.
* `create_native_delta_table` (Optional) Specifies whether the crawler will create native tables, to allow integration with query engines that support querying of the Delta transaction log directly.
* `delta_tables` - (Required) A list of the Amazon S3 paths to the Delta tables.
* `write_manifest` - (Required) Specifies whether to write the manifest files to the Delta table path.
* `create_native_delta_table` (Required) Specifies whether the crawler will create native tables, to allow integration with query engines that support querying of the Delta transaction log directly.

### Schema Change Policy

Expand Down

0 comments on commit ea18850

Please sign in to comment.