Skip to content
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

Add a way to disable map type support. #1046

Closed
GrzegorzSmardzewskiAllegro opened this issue Aug 23, 2023 · 1 comment
Closed

Add a way to disable map type support. #1046

GrzegorzSmardzewskiAllegro opened this issue Aug 23, 2023 · 1 comment
Assignees

Comments

@GrzegorzSmardzewskiAllegro
Copy link

The Map read support added in #914 breaks backwards compatibility. We have arrays of records with fields named "key" and "value" and the connector incorrectly assumes that those should be serialized as maps which causes serialization errors, because our code expects an array there.

There should be a way to disable that behavior, via a property for example.

@sixdimensionalarray
Copy link

sixdimensionalarray commented Sep 20, 2023

Hi @davidrabinowitz bumping on this because we saw this impact production customers due to this backwards compatibility break. I think the offending section of code might be this:

Spark MapTypes don't have actual named "key/value" attributes, I am not sure why the code recognizes attributes with the names "key/value" and identifies those as MapTypes unless this is a BQ convention or something? MapTypes have key/value pairs, but they don't explicitly have attributes named "key" or "value".

I think the behavior that something that looks like a Map with a literal key/value attribute is that it should be an array of structs as was the previous behavior.

Either way, this is definitely breaks backwards compatibility and the previous expected interface, and don't see a workaround at the moment.

I can provide PySpark examples demonstrating what I expected the behavior to be if required/helpful.

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

No branches or pull requests

3 participants