Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glue table partition keys should be set to empty list instead of being unset #5206

Closed
f0rk opened this issue Jul 16, 2018 · 5 comments · Fixed by #16727
Closed

Glue table partition keys should be set to empty list instead of being unset #5206

f0rk opened this issue Jul 16, 2018 · 5 comments · Fixed by #16727
Labels
bug Addresses a defect in current functionality. service/glue Issues and PRs that pertain to the glue service. upstream Addresses functionality related to the cloud provider.
Milestone

Comments

@f0rk
Copy link
Contributor

f0rk commented Jul 16, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.1

  • provider.aws v1.24.0

Affected Resource(s)

  • aws_glue_catalog_table

Terraform Configuration Files

resource "aws_glue_catalog_table" "test" {
...
partition_keys = []
...
}

Expected Behavior

Partition keys should be set to an empty list.

Actual Behavior

Partition keys is unset.

Steps to Reproduce

  1. terraform apply

Important Factoids

I originally opened a support request with AWS because a view I was trying to create could not be queried. This was their response:

The issue could be caused by a bug in Athena views that the table property partitionKeys is not set when creating the table since they are not required parameters. I can reproduce the behavior and setting the partitionKeys as an empty list can mitigate the issue. I checked the tables in the views and confirmed that they have no partitionKeys property. Could you try this workaround and see if the issue still exists? Athena team is actively working to address the issue and the error message since it doesn't provide any useful information. Apologies for the inconvenience caused to you.

@bflad bflad added bug Addresses a defect in current functionality. upstream Addresses functionality related to the cloud provider. service/glue Issues and PRs that pertain to the glue service. labels Jul 16, 2018
@f0rk
Copy link
Contributor Author

f0rk commented Jul 17, 2018

I've tried to fix this issue, but I'm having trouble figuring out how to convince Terraform that an empty list is a value, and not no value at all. It seems many places in the code think that 0, "", [], etc. are no value at all. So when I hardcode an empty list to be set for partition keys, Terraform reports that the attribute is not set. Any ideas about how to work around this?

@rooozox
Copy link

rooozox commented May 6, 2020

Hitting this problem as well today. Any known workaround? (using terraform v0.12.2, aws provider v2.41)

@gmazelier
Copy link
Contributor

Same here. Made a quick local test: it seems that explicitly having an empty list for the partition keys fix the problem. Having nil does not behave the same when serialising. This need more test but I will a pull request soon.

@ghost
Copy link

ghost commented Jan 8, 2021

This has been released in version 3.23.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 5, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/glue Issues and PRs that pertain to the glue service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants