Compare two schemas returning differences between both
Compare two schemas returning differences between both
Example : val sc1 = struct("number" -> int, "name" -> int) val sc2 = struct("rebmun" -> int, "name" -> double) compareSchema(sc1, sc2)
Result : Seq( SchemaModification(path"number", RemoveField(int)), SchemaModification(path"name", ChangeFieldType(int, double)), SchemaModification(path"rebmun", AddField(int)) )
The entry schema
Schema to compare to
Rhe sequence of schema modification from sc1 to s2
Apply a modification to a schema
Apply a modification to a schema
Example : val sc = struct("number" -> int) val sm = SchemaModification(path"rebmun", AddField(int)) modifySchema(sc, sm)
Result : Success(struct("number" -> int, "rebmun" -> int)
The entry schema
A schema modication that must be applied to the entry schema
The schema after the modification