-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Terraform BigQuery Table Hive partitioning support #3335
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
Terraform BigQuery Table Hive partitioning support #3335
Conversation
|
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @slevenick, please review this PR or find an appropriate assignee. |
|
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
|
slevenick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Sorry it took so long to review, but this all looks great. Just a few notes on docs/tests. When you push a new commit it should successfully complete the checks as I standardized the release note comment
third_party/terraform/website/docs/r/bigquery_table.html.markdown
Outdated
Show resolved
Hide resolved
third_party/terraform/website/docs/r/bigquery_table.html.markdown
Outdated
Show resolved
Hide resolved
1 similar comment
slevenick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issues and this will likely require a rebase due to an unrelated PR that changed test structure.
If you can do the rebase I'll get this merged in, looks good!
0db16d3 to
da02a5e
Compare
1 similar comment
de0518e to
cb238ce
Compare
|
@slevenick I think I resolved all the issues, is there anything I still can do for this PR? |
Ah, sorry lost track of this. Looks like there are conflicts now with master, could you rebase on master and I can run tests and get this merged? |
cb238ce to
cdfef07
Compare
|
@slevenick done.I cannot see why the build fails, but let me know if I can help address the issue. |
Looks like the files aren't formatted correctly: |
|
@slevenick ran gofmt, build still fails though |
Looks like the problem is now: You can run |
75807a4 to
c101365
Compare
|
@slevenick ah sorry that was sloppy, tests are running succesfully now locally, but the builds still seems to fail. |
|
Sorry the process is a little rough around the edges. Looks like we enforce that gofmt must be run with a specific flag 😞 |
c101365 to
5d55d27
Compare
|
@slevenick that should fix it;-) |
slevenick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the addition!
|
FYI I tried using this today, no dice. The table does get created: But there's no sign of the partitions in the table schema: If I however run: bq mkdef \
--autodetect \
--ignore_unknown_values \
--source_format=NEWLINE_DELIMITED_JSON \
--hive_partitioning_mode=CUSTOM \
--hive_partitioning_source_uri_prefix=gs://anhistous-metonymic-7578834-analytics-staging-batched/data_type=jsonl/event_schema=playfab/{event_category:STRING}/{event_environment:STRING}/{event_date:DATE}/{event_hour:STRING}/{event_minute:STRING} \
gs://anhistous-metonymic-7578834-analytics-staging-batched/data_type=jsonl/event_schema=playfab/\* \
AnalyticsEnvironment:STRING,PlayFabEnvironment:STRING,SourceType:STRING,Source:STRING,EventNamespace:STRING,TitleId:STRING,GroupBatchId:STRING,BatchId:STRING,EventId:STRING,EventName:STRING,EntityType:STRING,EntityId:STRING,Timestamp:TIMESTAMP,ReceivedTimestamp:TIMESTAMP,BatchedTimestamp:TIMESTAMP,BatchJobName:STRING,EventAttributes:STRING \
> /Users/loek/Desktop/events_playfab_staging_hive_partitioned_batchedFollowed by: bq mk --table --location=US --external_table_definition=/Users/loek/Desktop/events_playfab_staging_hive_partitioned_batched external.events_playfab_hive_partitioned_batchedIt does work: & The only difference within the BQ UI I can see is that when going via the |
|
@LoekL can you create a new issue on https://github.com/terraform-providers/terraform-provider-google with steps to reproduce this problem so that we can look into this? |
|
yes @LoekL please raise an issue, I cannot reproduce your problem. If I apply this, hive partitioning works just fine. |






Fixes: hashicorp/terraform-provider-google#5664
As of March 2, range partioning / hive partitioning is GA, see https://cloud.google.com/bigquery/docs/release-notes.
Note: Doesn't support
require_partition_filterattribute as this isn't available from the used BigQuery SDK.Release Note Template for Downstream PRs (will be copied)