-
Notifications
You must be signed in to change notification settings - Fork 3
#710 Make the schema change renderer nested schema friendly. #713
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
Merged
yruslan
merged 4 commits into
main
from
feature/710-handle-nested-structs-in-notifications
Feb 25, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
80fbbae
#710 Make the schema change renderer nested schema friendly.
yruslan 790a100
#710 Make the schema change comparison case sensitive for notificatio…
yruslan 484fea4
#710 Make schema comparison case-sensitive for notification purposes.
yruslan eac3188
#710 Tidy up the code for Spark schema comparison.
yruslan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🌐 Web query:
Apache Spark Scala API ArrayType nested typeName catalogString simpleString behavior documentation💡 Result:
In Spark’s Scala API (
org.apache.spark.sql.types), these methods behave as follows forArrayType(including nested arrays):typeName: StringReturns the JSON type name for the data type. For
ArrayType, this is just"array"(it does not include the element type, even when nested). [1][2]simpleString: StringReturns a readable type string and recursively uses the nested type’s
simpleString. For an array, it renders like:array<elementTypeSimpleString>Example:
ArrayType(ArrayType(IntegerType))→array<array<int>>. [1][2]catalogString: StringReturns the string representation used when saving the type in external catalogs and recursively uses nested types’
catalogString. For an array, it renders like:array<elementTypeCatalogString>Example:
ArrayType(StructType(...))→array<struct<...>>. [1][2]SQL docs alignment
Spark SQL documentation describes
ArrayTypeasARRAY<element_type>, matching the angle-bracket form used bysimpleString/catalogString. [3]Sources: Spark
DataTypeAPI docs (definestypeName,simpleString,catalogString) [1], Spark ScalaDoc forArrayType[2], Spark SQL data types reference [3].🏁 Script executed:
Repository: AbsaOSS/pramen
Length of output: 1387
Preserve nested array detail in rendered type strings.
Using
a.elementType.typeNamereturns just"array"for nested arrays, collapsing type detail (e.g.,array<array<int>>becomesarray<array>). This reduces fidelity of new/deleted type notifications.💡 Proposed fix
def dataTypeToString(dt: DataType, metadata: Metadata): String = { val maxLength = getLengthFromMetadata(metadata).getOrElse(0) dt match { - case a: ArrayType if a.elementType.isInstanceOf[StructType] => "array<struct<...>>" - case a: ArrayType => s"array<${a.elementType.typeName}>" + case a: ArrayType => s"array<${dataTypeToString(a.elementType, metadata)}>" case _: StructType => "struct<...>" case _: StringType if maxLength > 0 => s"varchar($maxLength)" case _ => dt.typeName } }The recursive call handles both nested arrays and struct arrays correctly, consolidating the special case.
🤖 Prompt for AI Agents