make bigsampler bq output partition configurable#705
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #705 +/- ##
==========================================
- Coverage 71.09% 70.91% -0.18%
==========================================
Files 44 44
Lines 1816 1822 +6
Branches 292 301 +9
==========================================
+ Hits 1291 1292 +1
- Misses 525 530 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
monzalo14
reviewed
Feb 26, 2024
monzalo14
approved these changes
Feb 27, 2024
monzalo14
left a comment
Member
There was a problem hiding this comment.
I'd love if you could separate formatting changes from actual changes, but LGTM!
Comment on lines
+104
to
+113
| | --sample=<percentage> Percentage of records to take in sample, a decimal between 0.0 and 1.0 | ||
| | --input=<path> Input file path or BigQuery table | ||
| | --output=<path> Output file path or BigQuery table | ||
| | [--fields=<field1,field2,...>] An optional list of fields to include in hashing for sampling cohort selection | ||
| | [--seed=<seed>] An optional seed used in hashing for sampling cohort selection | ||
| | [--hashAlgorithm=(murmur|farm)] An optional arg to select the hashing algorithm for sampling cohort selection. Defaults to FarmHash for BigQuery compatibility | ||
| | [--distribution=(uniform|stratified)] An optional arg to sample for a stratified or uniform distribution. Must provide `distributionFields` | ||
| | [--distributionFields=<field1,field2,...>] An optional list of fields to sample for distribution. Must provide `distribution` | ||
| | [--exact] An optional arg for higher precision distribution sampling. | ||
| | [--byteEncoding=(raw|hex|base64)] An optional arg for how to encode fields of type bytes: raw bytes, hex encoded string, or base64 encoded string. Default is to hash raw bytes. |
Member
There was a problem hiding this comment.
Nit: Is it possible to separate formatting changes into a different PR?
Contributor
Author
There was a problem hiding this comment.
not really, since I'm aligning the new whitespace with the field being added in this PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds a new arg to BigSampler called
bigqueryPartitioning, defaults to "DAY", which should maintain the same behavior as before. Users can pass in "DAY|HOUR|MONTH|YEAR", as well as NULL if no table partitioning is desired.Making this change so that Ratatool works better with Spotify's internal Luigi BigQuery tasks, which use table sharding as partitioning, and when ratatool sets the partitioning to ingestion day, it causes problems with retention.
Tested by outputting this table via this workflow:
the
43ea5c916cd5a85623bf0de598da15982c29d8952dbf63a068d10e5b56466e61docker image is using my local ratatool PR's code viasbt publishM2the linked table has to partitioning and uses the sharding generated by the BigQueryTarget in Luigi
here is another table that is using the
--bigquery-partitioningarg to set the partitioning to "MONTH".