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 support for handling empty schemas and records #237

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

mkubala
Copy link
Contributor

@mkubala mkubala commented Jan 7, 2020

Sometimes record types contain fields of type that do not have any fields defined (null objects, marker classes etc.).
Converters must omit them since it's impossible to map empty structures into BigQuery table schema and rows.

This is the first of PRs derived from #219

Sometimes record types contain fields of type that do not have any fields defined (null objects, marker classes etc.).
Converters must omit them since it's impossible to map empty structures into BigQuery table schema and rows.
@jaroslawZawila
Copy link

@mtagle @criccomini @C0urante Any progress on this one?

@criccomini
Copy link
Contributor

Will have @mtagle take a look at this shortly

@mtagle
Copy link
Contributor

mtagle commented Jan 30, 2020

This looks fine, but sort of out of style with the rest of the code base. Can you tell me why using Optional/list comprehensions/other functional stuff is preferable to more "standard" imperative approach?

@mkubala
Copy link
Contributor Author

mkubala commented Jan 31, 2020

I've been programming in Scala for last 5-6 years and I get used to optionals and list comprehensions.

It was just easier to write for me and I thought since Java has the Streams API it's natural descendant of for comprehensions and mutable classes, just like for comprehensions at some point for comps crowded while loops out.
If you prefer to stay with the original approach - I'm ok with it.

@mtagle
Copy link
Contributor

mtagle commented Jan 31, 2020

hm, in practice I suppose other code will only be interacting with the schema converters in the convertSchema method, which isn't touched, so I think I'm okay with the style variance.

@mtagle mtagle merged commit 08f1a01 into wepay:master Jan 31, 2020
@mkubala mkubala deleted the empty_structs_handling branch February 3, 2020 08:37
@mkubala mkubala restored the empty_structs_handling branch March 19, 2020 18:14
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.

None yet

4 participants