Skip to content

Conversation

@piyush-zlai
Copy link
Contributor

@piyush-zlai piyush-zlai commented Jun 20, 2025

Summary

A stab at adding the GBU Planner based on some existing ones.

Checklist

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested
  • Documentation update

Summary by CodeRabbit

  • New Features
    • Introduced support for planning and executing group-by upload steps with new configuration and execution options.
  • Tests
    • Added comprehensive tests validating group-by upload planning and batch execution, ensuring correct plan generation and consistent behavior.
  • Chores
    • Updated command-line runners to support the new group-by uploads configuration type and enhanced argument handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

Walkthrough

The changes remove the uploadNode method from GroupByPlanner and introduce a new GroupByUploadPlanner class with upload planning logic. LocalRunner and BatchNodeRunner are updated to support "groupby_uploads" and "group_by_upload" modes respectively. New tests cover GroupByUploadPlanner and batch runner upload node handling.

Changes

File(s) Change Summary
api/src/main/scala/ai/chronon/api/planner/GroupByPlanner.scala Removed uploadNode method.
api/src/main/scala/ai/chronon/api/planner/GroupByUploadPlanner.scala Added GroupByUploadPlanner class with upload node and plan building.
api/src/main/scala/ai/chronon/api/planner/LocalRunner.scala Added "groupby_uploads" case to main method to run GroupByUploadPlanner.
spark/src/main/scala/ai/chronon/spark/batch/BatchNodeRunner.scala Added support for "group_by_upload" confType; added runGroupByUpload method; updated parsing.
api/src/test/scala/ai/chronon/api/test/planner/GroupByUploadPlannerTest.scala Added tests validating GroupByUploadPlanner plan creation and semantic hashing.
spark/src/test/scala/ai/chronon/spark/test/batch/BatchNodeRunnerTest.scala Added tests for GroupByUploadNode config loading and validation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LocalRunner
    participant GroupByUploadPlanner
    participant ConfPlan

    User->>LocalRunner: Run with "groupby_uploads" confType
    LocalRunner->>GroupByUploadPlanner: Create planner for each GroupBy config
    GroupByUploadPlanner->>GroupByUploadPlanner: buildPlan()
    GroupByUploadPlanner->>ConfPlan: Create ConfPlan with upload node
    ConfPlan-->>LocalRunner: Return plan
    LocalRunner-->>User: Print plan
Loading
sequenceDiagram
    participant BatchRunner
    participant NodeContent
    participant GroupByUploadNode
    participant GroupByUpload

    BatchRunner->>NodeContent: loadNodeContent("group_by_upload")
    NodeContent->>GroupByUploadNode: Wrap GroupBy config
    BatchRunner->>BatchRunner: runGroupByUpload()
    BatchRunner->>GroupByUpload: run upload with config and partition
    BatchRunner-->>User: Log success
Loading

Suggested reviewers

  • nikhil-zlai
  • david-zlai
  • tchow-zlai

Poem

🚀 Uploads take flight, a planner reborn,
GroupBy’s new path, from dusk till dawn.
Nodes rearranged, tests in the fray,
LocalRunner guides the way.
Hashes hold steady, metadata shed,
Batch runs upload, with plans well read.
Code evolves anew, progress is drawn! 🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0994b6e and 797a730.

📒 Files selected for processing (2)
  • spark/src/main/scala/ai/chronon/spark/batch/BatchNodeRunner.scala (6 hunks)
  • spark/src/test/scala/ai/chronon/spark/test/batch/BatchNodeRunnerTest.scala (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: cloud_aws_tests
  • GitHub Check: streaming_tests
  • GitHub Check: service_commons_tests
  • GitHub Check: online_tests
  • GitHub Check: analyzer_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: spark_tests
  • GitHub Check: service_tests
  • GitHub Check: join_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: batch_tests
  • GitHub Check: flink_tests
  • GitHub Check: api_tests
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (10)
spark/src/test/scala/ai/chronon/spark/test/batch/BatchNodeRunnerTest.scala (3)

3-5: New imports look appropriate for GroupByUpload functionality.


85-108: Test validates configuration setup correctly.

The test properly creates and validates a GroupByUpload configuration. Using null for start partition (line 102) is consistent with the optional startDs behavior but ensure downstream code handles this appropriately.


140-146: Configuration loading test follows established pattern.

spark/src/main/scala/ai/chronon/spark/batch/BatchNodeRunner.scala (7)

6-7: Import additions support new GroupByUpload functionality.


22-22: Making startDs optional enables GroupByUpload operations.


32-32: Added "group_by_upload" to valid configuration types.


58-59: Properly routes GroupByUpload nodes to dedicated handler.


127-132: Configuration loading follows established pattern.


154-157: Proper handling of optional startDs parameter.

Using toOption.orNull correctly converts optional parameter for downstream consumption.


65-75: ```shell
#!/bin/bash

dump run block

sed -n '200,250p' spark/src/main/scala/ai/chronon/spark/GroupByUpload.scala


</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAQVp6AHEAIQBVHi9Mcj4AajCQxGjIAHc0ZAcBZnUaejkw2A9sREoeeFkm2DAAL0ydMus7DEcBFoAOUYBmfixcBr8SbnxEdXwXDRg5pgxcCngBPHh8LHhtikVsBml0SHJiyBT0q0yMbIAaSCUpL3xuKIEyqJHewsDwkAAeSHEGCIGSylEQ63c9mwlSQyyBJwYXmwSmQ2Aw6nyiFwyAIkCkuwAZvJZh5KfixIcMGgvOp5PhKfUPLdYS9KOtYgwmBRaCcYWTaR9pAxdtxxEd3pKGLBMKRkCqpDd8KFZCRQiMyAoKX95ODIWKFNsTth8E0UNsSEQqPKsAAKADCAEkAJQlVYAa0p32KiHeGFWkA1Hlp8nxSgoRCOHhONCd1CZRKhMIjtHwDEc7HTQOw3Fo1GkiLmtnQ8GYpPwkHBNAw9El3GeBOhjDQ3BU8FZ4iudTQCQts1QPPbcL4TGYi3I23Q3y7xXUsBQJPQiEQefg5dbBQ0Rn0xnAUDI9A5OAIxDIyhqClY7C4vH4wlE4ikMnkTHjKjUmjaLoYCGCYUBwKgqCYNehCkNk+6Pmw2xcFQdwOE4LiQHUv7KKo6haDoJ6nqYBg9vA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YBAAA2EgAAdiFaFalYAFZdCGAlWGAABGCYAAJhFbQHFcpAmH+CVdoBFeVdlaVaFbugmDQG1b5YFYgEgFlZFdlbQFlYmAVY1doG1fFYmDVYmF6gSFoCtaleKxIAEEuA1e1aFYYG9cpG1ZlftYdagCZdwBZZIXZcSg6lRloGUwvD5aAA -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=zipline-ai/chronon&utm_content=883):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

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)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
api/src/main/scala/ai/chronon/api/planner/LocalRunner.scala (1)

69-71: Update error message to include new conf type.

Error message still lists old supported types.

-          s"Unsupported conf type: $confType. Supported types are: joins, staging_queries."
+          s"Unsupported conf type: $confType. Supported types are: joins, staging_queries, groupby_uploads."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad32e77 and 0994b6e.

📒 Files selected for processing (4)
  • api/src/main/scala/ai/chronon/api/planner/GroupByPlanner.scala (0 hunks)
  • api/src/main/scala/ai/chronon/api/planner/GroupByUploadPlanner.scala (1 hunks)
  • api/src/main/scala/ai/chronon/api/planner/LocalRunner.scala (3 hunks)
  • api/src/test/scala/ai/chronon/api/test/planner/GroupByUploadPlannerTest.scala (1 hunks)
💤 Files with no reviewable changes (1)
  • api/src/main/scala/ai/chronon/api/planner/GroupByPlanner.scala
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: service_commons_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: online_tests
  • GitHub Check: api_tests
  • GitHub Check: service_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: flink_tests
  • GitHub Check: batch_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: scala_compile_fmt_fix
🔇 Additional comments (14)
api/src/main/scala/ai/chronon/api/planner/LocalRunner.scala (3)

4-4: LGTM on import additions.

The new imports support the added functionality correctly.


39-42: Usage comment is clear and helpful.

Good documentation for running the tool.


64-67: New groupby_uploads case implemented correctly.

The implementation follows the same pattern as existing cases.

api/src/main/scala/ai/chronon/api/planner/GroupByUploadPlanner.scala (5)

1-9: Well-structured class definition.

Good use of case class and proper inheritance.


11-13: Clean dependency extraction and constants.

Good separation of concerns.


15-19: Smart execution info erasure.

Prevents heavy data duplication as intended.


21-25: Proper semantic groupBy creation.

Correctly removes metadata for semantic hashing.


27-33: Upload node creation looks correct.

Proper metadata layering and node construction.

api/src/test/scala/ai/chronon/api/test/planner/GroupByUploadPlannerTest.scala (6)

14-33: Excellent validation helper method.

Comprehensive checks for plan structure and contents.


35-51: Good integration test with real configs.

Tests against actual configuration files.


53-63: Clean unit test with programmatic GroupBy.

Good validation of terminal node naming.


65-84: Important semantic hash consistency test.

Verifies metadata exclusion from semantic hashing.


86-105: Thorough executionInfo semantic hash test.

Confirms execution environment changes don't affect semantics.


108-122: Well-designed test helper method.

Clean GroupBy construction for testing.

Comment on lines +35 to +44
override def buildPlan: ConfPlan = {
val terminalNodeNames = Map(
ai.chronon.planner.Mode.DEPLOY -> uploadNode.metaData.name
)
val confPlan = new ConfPlan()
.setNodes(List(uploadNode).asJava)
.setTerminalNodeNames(terminalNodeNames.asJava)
confPlan.setNodes(List(uploadNode).asJava)
confPlan
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove duplicate nodes assignment.

Line 42 redundantly sets nodes after line 40.

     val confPlan = new ConfPlan()
       .setNodes(List(uploadNode).asJava)
       .setTerminalNodeNames(terminalNodeNames.asJava)
-    confPlan.setNodes(List(uploadNode).asJava)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
override def buildPlan: ConfPlan = {
val terminalNodeNames = Map(
ai.chronon.planner.Mode.DEPLOY -> uploadNode.metaData.name
)
val confPlan = new ConfPlan()
.setNodes(List(uploadNode).asJava)
.setTerminalNodeNames(terminalNodeNames.asJava)
confPlan.setNodes(List(uploadNode).asJava)
confPlan
}
override def buildPlan: ConfPlan = {
val terminalNodeNames = Map(
ai.chronon.planner.Mode.DEPLOY -> uploadNode.metaData.name
)
val confPlan = new ConfPlan()
.setNodes(List(uploadNode).asJava)
.setTerminalNodeNames(terminalNodeNames.asJava)
confPlan
}
🤖 Prompt for AI Agents
In api/src/main/scala/ai/chronon/api/planner/GroupByUploadPlanner.scala between
lines 35 and 44, the method buildPlan sets the nodes on confPlan twice, once at
line 40 and again at line 42. Remove the redundant call at line 42 to avoid
unnecessary duplication and keep only the first setNodes invocation.

case class GroupByUploadPlanner(groupBy: GroupBy)(implicit outputPartitionSpec: PartitionSpec)
extends Planner[GroupBy](groupBy)(outputPartitionSpec) {

private def tableDeps: Seq[TableDependency] = TableDependencies.fromGroupBy(groupBy)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of this one is that the GBU would have a dependency on the groupby's output table, whereas this function is generating the dependencies of the groupby job itself (which would be the source tables). So there might need to be new logic here to produce the groupby output table as a dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the GBU doesn't depend on the GroupBy backfill output table. GBU does indeed only depend on the src tables so I think we should be fine here if we're depending on the src tables..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see it ! Thanks for clarifying.

@piyush-zlai piyush-zlai merged commit 52ec49a into main Jun 23, 2025
26 of 28 checks passed
@piyush-zlai piyush-zlai deleted the piyush/gbu_planning branch June 23, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants