-
Notifications
You must be signed in to change notification settings - Fork 8
[Untested] Vz cherry pick oss avro schema #170
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
WalkthroughThis pull request introduces a new 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 (
|
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 (1)
api/src/main/scala/ai/chronon/api/Row.scala (1)
128-174: Method is lengthy.
Consider breaking out sub-logic to smaller methods for clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (5)
api/src/main/scala/ai/chronon/api/Row.scala(3 hunks)online/src/main/scala/ai/chronon/online/AvroConversions.scala(4 hunks)online/src/main/scala/ai/chronon/online/Fetcher.scala(1 hunks)online/src/main/scala/ai/chronon/online/SparkConversions.scala(1 hunks)spark/src/main/scala/ai/chronon/spark/utils/InMemoryStream.scala(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: table_utils_delta_format_spark_tests
- GitHub Check: other_spark_tests
- GitHub Check: mutation_spark_tests
- GitHub Check: fetcher_spark_tests
- GitHub Check: scala_compile_fmt_fix
- GitHub Check: join_spark_tests
- GitHub Check: no_spark_scala_tests
🔇 Additional comments (7)
online/src/main/scala/ai/chronon/online/AvroConversions.scala (2)
Line range hint
116-138: Ensure null-safety for extraneousRecord.
If extraneousRecord is null, calling it may cause a runtime exception.
190-222: Validate union with two types.
Using get(1) assumes exactly two union types, which can fail otherwise.api/src/main/scala/ai/chronon/api/Row.scala (2)
43-71: Trait addition looks good.
SchemaTraverser is compact and meets the usage needs.
Line range hint
179-233: Type mismatch risk.
No fallback if item count or types deviate from assumptions in list/map.online/src/main/scala/ai/chronon/online/SparkConversions.scala (1)
140-143: New signature usage is clear.
Integration with Row.to looks correct.spark/src/main/scala/ai/chronon/spark/utils/InMemoryStream.scala (1)
103-103: Schema param passed correctly.
AvroConversions call now includes avroSchema properly.online/src/main/scala/ai/chronon/online/Fetcher.scala (1)
304-304: Good usage of codec schema.
Ensures consistent encoding with the new schema param.
* Cleanup and isolate the schema perf changes * add an _
1e28794 to
9910286
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)
api/src/main/scala/ai/chronon/api/Row.scala (2)
43-71: LGTM! Minor typo in documentation.Fix typo in comment:
- // Returns the valye type of the current map field type. + // Returns the value type of the current map field type.
202-233: Consider DRYing up map handling logic.The map handling logic is duplicated between
util.Mapandimmutable.Mapcases.Extract common logic:
def processMapEntry(key: Any, value: Any, keyType: DataType, valueType: DataType, schemaTraverser: Option[SchemaTraverser[OutputSchema]]): (Any, Any) = ( edit(key, keyType, schemaTraverser.map(_.getMapKeyType)), edit(value, valueType, schemaTraverser.map(_.getMapValueType)) )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (5)
api/src/main/scala/ai/chronon/api/Row.scala(3 hunks)online/src/main/scala/ai/chronon/online/AvroConversions.scala(4 hunks)online/src/main/scala/ai/chronon/online/Fetcher.scala(1 hunks)online/src/main/scala/ai/chronon/online/SparkConversions.scala(1 hunks)spark/src/main/scala/ai/chronon/spark/utils/InMemoryStream.scala(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- online/src/main/scala/ai/chronon/online/Fetcher.scala
- spark/src/main/scala/ai/chronon/spark/utils/InMemoryStream.scala
- online/src/main/scala/ai/chronon/online/SparkConversions.scala
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: other_spark_tests
- GitHub Check: table_utils_delta_format_spark_tests
- GitHub Check: join_spark_tests
- GitHub Check: mutation_spark_tests
- GitHub Check: scala_compile_fmt_fix
- GitHub Check: fetcher_spark_tests
- GitHub Check: no_spark_scala_tests
🔇 Additional comments (5)
api/src/main/scala/ai/chronon/api/Row.scala (2)
128-136: LGTM! Clean signature update.The changes maintain backward compatibility while adding schema traversal support.
139-144: LGTM! Well-structured helper functions.Clean implementation with proper null handling.
online/src/main/scala/ai/chronon/online/AvroConversions.scala (3)
Line range hint
117-142: LGTM! Clean integration with SchemaTraverser.The changes properly integrate schema traversal capabilities.
Line range hint
176-189: LGTM! Consistent schema handling.Both encode methods properly utilize the schema traversal capabilities.
194-231: Add unit tests for AvroSchemaTraverser.The PR objectives indicate missing tests. This new class needs coverage.
Would you like me to generate unit tests for this class?
nikhil-zlai
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.
LGTM!
## Summary Cherry picking avro schema parsing improvements ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update - [x] Untested <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SchemaTraverser` trait to enhance schema traversal capabilities. - Added advanced schema handling for Avro and Spark data conversions. - **Improvements** - Enhanced row conversion methods with more flexible schema processing. - Improved support for complex data types and schema representations. - Updated encoding and conversion methods across multiple components. - **Technical Enhancements** - Implemented `AvroSchemaTraverser` for more robust Avro schema navigation. - Refined data conversion methods to support more flexible schema handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Spencer McNamara <[email protected]> Co-authored-by: ezvz <[email protected]> Co-authored-by: Thomas Chow <[email protected]>
## Summary Cherry picking avro schema parsing improvements ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update - [x] Untested <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SchemaTraverser` trait to enhance schema traversal capabilities. - Added advanced schema handling for Avro and Spark data conversions. - **Improvements** - Enhanced row conversion methods with more flexible schema processing. - Improved support for complex data types and schema representations. - Updated encoding and conversion methods across multiple components. - **Technical Enhancements** - Implemented `AvroSchemaTraverser` for more robust Avro schema navigation. - Refined data conversion methods to support more flexible schema handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Spencer McNamara <[email protected]> Co-authored-by: ezvz <[email protected]>
## Summary Cherry picking avro schema parsing improvements ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update - [x] Untested <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SchemaTraverser` trait to enhance schema traversal capabilities. - Added advanced schema handling for Avro and Spark data conversions. - **Improvements** - Enhanced row conversion methods with more flexible schema processing. - Improved support for complex data types and schema representations. - Updated encoding and conversion methods across multiple components. - **Technical Enhancements** - Implemented `AvroSchemaTraverser` for more robust Avro schema navigation. - Refined data conversion methods to support more flexible schema handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Spencer McNamara <[email protected]> Co-authored-by: ezvz <[email protected]>
## Summary Cherry picking avro schema parsing improvements ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update - [x] Untested <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SchemaTraverser` trait to enhance schema traversal capabilities. - Added advanced schema handling for Avro and Spark data conversions. - **Improvements** - Enhanced row conversion methods with more flexible schema processing. - Improved support for complex data types and schema representations. - Updated encoding and conversion methods across multiple components. - **Technical Enhancements** - Implemented `AvroSchemaTraverser` for more robust Avro schema navigation. - Refined data conversion methods to support more flexible schema handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Spencer McNamara <[email protected]> Co-authored-by: ezvz <[email protected]>
## Summary Cherry piour clientsing avro schema parsing improvements ## Cheour clientslist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update - [x] Untested <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `SchemaTraverser` trait to enhance schema traversal capabilities. - Added advanced schema handling for Avro and Spark data conversions. - **Improvements** - Enhanced row conversion methods with more flexible schema processing. - Improved support for complex data types and schema representations. - Updated encoding and conversion methods across multiple components. - **Technical Enhancements** - Implemented `AvroSchemaTraverser` for more robust Avro schema navigation. - Refined data conversion methods to support more flexible schema handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Spencer McNamara <[email protected]> Co-authored-by: ezvz <[email protected]>
Summary
Cherry picking avro schema parsing improvements
Checklist
Summary by CodeRabbit
New Features
SchemaTraversertrait to enhance schema traversal capabilities.Improvements
Technical Enhancements
AvroSchemaTraverserfor more robust Avro schema navigation.