diff --git a/modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Migrations.scala b/modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Migrations.scala index 8a3b4df4..a13f331c 100644 --- a/modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Migrations.scala +++ b/modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Migrations.scala @@ -87,7 +87,10 @@ object Migrations { } // Comparing struct target fields to the source. This will detect additions. - val reverseMigration = targetFields.map(tgtField => MigrationFieldPair(tgtField.name :: path, tgtField, sourceStruct.focus(tgtField.name)).migrations) + val reverseMigration = targetFields.map { + tgtField => + MigrationFieldPair(tgtField.name :: path, tgtField, sourceStruct.focus(tgtField.name)).migrations + } migrations ++= forwardMigration.iterator.flatMap(_.migrations) diff --git a/modules/core/src/test/scala/com/snowplowanalytics/iglu/schemaddl/parquet/MigrationSpec.scala b/modules/core/src/test/scala/com/snowplowanalytics/iglu/schemaddl/parquet/MigrationSpec.scala index 8c43e653..e3709b2a 100644 --- a/modules/core/src/test/scala/com/snowplowanalytics/iglu/schemaddl/parquet/MigrationSpec.scala +++ b/modules/core/src/test/scala/com/snowplowanalytics/iglu/schemaddl/parquet/MigrationSpec.scala @@ -526,18 +526,18 @@ class MigrationSpec extends org.specs2.Specification { def e17 = { val struct1 = Type.Struct( NonEmptyVector.of( - Field("zzz", Type.String, Nullable), - Field("yyy", Type.String, Nullable), + Field("vvv", Type.String, Nullable), Field("xxx", Type.String, Nullable), + Field("zzz", Type.String, Nullable), ) ) val struct2 = Type.Struct( NonEmptyVector.of( + Field("vvv", Type.String, Required), + Field("www", Type.String, Required), Field("xxx", Type.String, Required), - Field("new1", Type.String, Required), Field("yyy", Type.String, Required), - Field("new2", Type.String, Required), Field("zzz", Type.String, Required), ) ) @@ -545,12 +545,12 @@ class MigrationSpec extends org.specs2.Specification { val expectedStruct = Type.Struct( NonEmptyVector.of( // original fields - Field("zzz", Type.String, Nullable), - Field("yyy", Type.String, Nullable), + Field("vvv", Type.String, Nullable), Field("xxx", Type.String, Nullable), + Field("zzz", Type.String, Nullable), // added fields - Field("new1", Type.String, Nullable), - Field("new2", Type.String, Nullable), + Field("www", Type.String, Nullable), + Field("yyy", Type.String, Nullable), ) )