Skip to content

Never use REQUIRED mode for new nested fields of existing columns#403

Closed
Ian Streeter (istreeter) wants to merge 1 commit intodevelopfrom
fix/nullable-nested-addditions
Closed

Never use REQUIRED mode for new nested fields of existing columns#403
Ian Streeter (istreeter) wants to merge 1 commit intodevelopfrom
fix/nullable-nested-addditions

Conversation

@istreeter
Copy link
Contributor

@istreeter Ian Streeter (istreeter) commented Apr 29, 2025

There are edge case tables/schemas in which the loader previously tried to alter the table to add a required nested column to a pre-existing struct column. We saw this error message:

message": "Provided Schema does not match Table <redacted>:<redacted>.events. Cannot add required fields to an existing schema. (field: <redacted>.<redacted>)

This scenario happens only if a schema has been patched after the loader already created the column; or if the table is manually altered; or other similar mis-uses of schemas.

This commit works around the issue by forcing nested columns to be NULLABLE if the parent struct column already exists.

There are edge case tables/schemas in which the loader previously tried
to alter the table to add a required nested column to a pre-existing
struct column.  We saw this error message:

```
message": "Provided Schema does not match Table <redacted>:<redacted>.events. Cannot add required fields to an existing schema. (field: <redacted>.<redacted>)
```

This scenario happens only if a schema has been patched after the loader
already created the column; or if the table is manually altered; or
other similar mis-uses of schemas.

This commit works around the issue by forcing nested columns to be
NULLABLE if the parent struct column already exists.
@istreeter Ian Streeter (istreeter) force-pushed the fix/nullable-nested-addditions branch from fec2e05 to e41d8ef Compare April 29, 2025 11:17
@istreeter Ian Streeter (istreeter) deleted the fix/nullable-nested-addditions branch April 29, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants