You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#886 Do not replace primitive to non-ptimitive types and vice versa when copying metadata between schemas - #887
No actionable comments were generated in the recent review.
Walkthrough
copyMetadata now copies a source data type only when both corresponding field types are primitive. A test covers schemas with opposite primitive and struct shapes, including the resulting field types and copied metadata.
Changes
Metadata copying
Layer / File(s)
Summary
Guard data type copying spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/utils/SparkUtils.scala, spark-cobol/src/test/scala/za/co/absa/cobrix/spark/cobol/utils/SparkUtilsSuite.scala
copyMetadata checks that both corresponding field types are primitive before copying the source data type. The test checks the result for schemas with opposite primitive and struct shapes, including field types and maxLength metadata.
Issue 886 describes copyMetadata replacing a struct field with a primitive when copyDataType = true. This change addresses the same behavior by restricting type copying to primitive source and target fields.
Merge Risk: Minimal · up to 8d03b
This change stops copyMetadata from replacing a non-primitive field type with a primitive one when data types are copied. It is narrowly scoped, has test coverage, and the known production caller does not use the affected path. No merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title states the main change: copyMetadata no longer replaces a primitive type with a non-primitive type, or the reverse. The raw summary confirms the code now copies a primitive data type only wh…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: copyMetadata no longer replaces a primitive type with a non-primitive type, or the reverse. The raw summary confirms the code now copies a primitive data type only when both source and destination are primitive, and the added test covers the struct-to-primitive case. The PR number prefix is harmless. The title is specific and matches the changeset.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each field with care Primitive types match pair by pair A struct keeps its shape in place Metadata finds its proper space Then hops away with schemas fair
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a2ff63a5-086c-4268-87e0-e8bc085c7a12
Commits
Reviewing files that changed from the base of the PR and between ab4bfb7 and 8d03bc5.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
yruslan
changed the title
#886 Avoid replacing non-primitive field types when copying metadata.
#886 Do not replace primitive to non-ptimitive types and vice versa when copying metadata between schemas
Nov 23, 2026
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
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.
Summary by CodeRabbit