-
Notifications
You must be signed in to change notification settings - Fork 0
Temporary hack to work with partition values stored as yyyy-MM-dd but represented as yyyyMMdd in information schema in bq. #175
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
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
Warning Review ran into problems🔥 ProblemsGitHub Actions: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository. Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala
Outdated
Show resolved
Hide resolved
… represented as yyyyMMdd in information schema in bq.
…we're already doing the date formatting.
01a81dd
to
0a2ea05
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala (2)
151-153
: Track this technical debt.Create a ticket to standardize on
yyyyMMdd
format for future BigQuery data storage.Want me to create a GitHub issue to track this technical debt?
162-167
: Remove misleading comment about hardcoded format.The
"yyyyMMdd"
format must match BigQuery's INFORMATION_SCHEMA format - it's not something we can change.- "yyyyMMdd" // Note: this "yyyyMMdd" format is hardcoded but we need to change it to be something else. + "yyyyMMdd" // Note: this matches BigQuery's INFORMATION_SCHEMA.PARTITIONS format
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (1)
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: scala_compile_fmt_fix
🔇 Additional comments (2)
cloud_gcp/src/main/scala/ai/chronon/integrations/cloud_gcp/BigQueryFormat.scala (2)
15-15
: LGTM! Import required for date formatting.
154-154
: LGTM! Good use of Spark configuration for format flexibility.
… represented as yyyyMMdd in information schema in bq. (#175) ## Summary We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table. in particular, we see that the raw bq table will have `ds` in `yyyy-MM-dd` but for some reason BQ will represent that `ds` partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted as `yyyyMMdd` (no dashes). To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be `yyyyMMdd`. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209110958473706 Co-authored-by: Thomas Chow <[email protected]>
## Summary - do some date formatting because the input partitions may be of `DATE` type, so we need to normalize them to a string. - inline some options for bigquery writes for now, will follow up with more abstracted handling. See: #175 ## Checklist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated partition column and format handling in DataFrame processing. - Modified visibility of `partitionFormat` to improve package-level access. - Removed optional write format variable from TableUtils. These changes enhance the functionality of data processing utilities by refining how partition columns are managed and accessed within the Spark extensions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
… represented as yyyyMMdd in information schema in bq. (#175) ## Summary We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table. in particular, we see that the raw bq table will have `ds` in `yyyy-MM-dd` but for some reason BQ will represent that `ds` partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted as `yyyyMMdd` (no dashes). To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be `yyyyMMdd`. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209110958473706
## Summary - do some date formatting because the input partitions may be of `DATE` type, so we need to normalize them to a string. - inline some options for bigquery writes for now, will follow up with more abstracted handling. See: #175 ## Checklist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated partition column and format handling in DataFrame processing. - Modified visibility of `partitionFormat` to improve package-level access. - Removed optional write format variable from TableUtils. These changes enhance the functionality of data processing utilities by refining how partition columns are managed and accessed within the Spark extensions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
… represented as yyyyMMdd in information schema in bq. (#175) ## Summary We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table. in particular, we see that the raw bq table will have `ds` in `yyyy-MM-dd` but for some reason BQ will represent that `ds` partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted as `yyyyMMdd` (no dashes). To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be `yyyyMMdd`. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209110958473706
## Summary - do some date formatting because the input partitions may be of `DATE` type, so we need to normalize them to a string. - inline some options for bigquery writes for now, will follow up with more abstracted handling. See: #175 ## Checklist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated partition column and format handling in DataFrame processing. - Modified visibility of `partitionFormat` to improve package-level access. - Removed optional write format variable from TableUtils. These changes enhance the functionality of data processing utilities by refining how partition columns are managed and accessed within the Spark extensions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
… represented as yyyyMMdd in information schema in bq. (#175) ## Summary We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table. in particular, we see that the raw bq table will have `ds` in `yyyy-MM-dd` but for some reason BQ will represent that `ds` partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted as `yyyyMMdd` (no dashes). To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be `yyyyMMdd`. ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209110958473706
## Summary - do some date formatting because the input partitions may be of `DATE` type, so we need to normalize them to a string. - inline some options for bigquery writes for now, will follow up with more abstracted handling. See: #175 ## Checklist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated partition column and format handling in DataFrame processing. - Modified visibility of `partitionFormat` to improve package-level access. - Removed optional write format variable from TableUtils. These changes enhance the functionality of data processing utilities by refining how partition columns are managed and accessed within the Spark extensions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
…MM-dd but represented as yyyyMMdd in information schema in bq. (#175) ## Summary We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table. in particular, we see that the raw bq table will have `ds` in `yyyy-MM-dd` but for some reason BQ will represent that `ds` partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted as `yyyyMMdd` (no dashes). To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be `yyyyMMdd`. ## Cheour clientslist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209110958473706
## Summary - do some date formatting because the input partitions may be of `DATE` type, so we need to normalize them to a string. - inline some options for bigquery writes for now, will follow up with more abstracted handling. See: #175 ## Cheour clientslist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated partition column and format handling in DataFrame processing. - Modified visibility of `partitionFormat` to improve paour clientsage-level access. - Removed optional write format variable from TableUtils. These changes enhance the functionality of data processing utilities by refining how partition columns are managed and accessed within the Spark extensions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to traour clients the status of staour clientss when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Thomas Chow <[email protected]>
Summary
We noticed a discrepancy of the date format between partitions in INFORMATION_SCHEMA.PARTITIONS in bigquery vs how it's represented in the actual bq table.
in particular, we see that the raw bq table will have
ds
inyyyy-MM-dd
but for some reason BQ will represent thatds
partition id in INFORMATION_SCHEMA.PARTITIONS to be formatted asyyyyMMdd
(no dashes).To work around this, we're coding with the assumption that partition ids in INFORMATION_SCHEMA.PARTITIONS to be
yyyyMMdd
.Checklist