snowplow / schema-ddl

ASTs and generators for producing various DDL and Schema formats
Apache License 2.0
5 stars 4 forks source link

Preserve original field order when merging parquet Fields #213

Open istreeter opened 1 week ago

istreeter commented 1 week ago

We use the Migrations.mergeSchema function in the loaders, for combining a series of schemas (e.g. 1-0-0, 1-0-1, 1-0-2) into a reconciled column

Before this PR, mergeSchemas contained some logic to preserve field order... but it was the wrong logic. It preserved field order of the newer schema, ignoring whether a field was present in the older schema.

After this PR, we preserve field order of the older schema. New fields added in a later schema are appended to the end of the field list.

This feature change is needed for loaders that only allow field additions when they are appended to the end of a struct. E.g. the Lake Loader for Hudi/Glue.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 11973201274

Details


Files with Coverage Reduction New Missed Lines %
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/mutate/Mutate.scala 1 77.05%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/bigquery/Row.scala 1 69.23%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/JsonPath.scala 1 85.71%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/circe/CommonCodecs.scala 1 75.0%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/redshift/internal/ColumnTypeSuggestions.scala 1 78.89%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/mutate/Widened.scala 1 87.27%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/redshift/ShredModelEntry.scala 2 86.54%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Caster.scala 2 83.33%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/parquet/Suggestion.scala 2 90.0%
modules/core/src/main/scala/com.snowplowanalytics/iglu.schemaddl/jsonschema/circe/StringCodecs.scala 2 71.43%
<!-- Total: 14 -->
Totals Coverage Status
Change from base Build 11124453738: -0.4%
Covered Lines: 1277
Relevant Lines: 1590

💛 - Coveralls