Skip to content

[BEAM-13959] Fix StorageApi writes when a field is named f - #16872

Merged
reuvenlax merged 1 commit into
apache:masterfrom
reuvenlax:fix_vortex_f
Feb 17, 2022
Merged

reuvenlax merged 1 commit into
apache:masterfrom
reuvenlax:fix_vortex_f

Conversation

@reuvenlax

Copy link
Copy Markdown
Contributor

The TableRow class supports being used as a JSON map (set()/get()) or as a list of TableCell elements (setF()/getF()). When used in the former manner, a column cannot be named 'f', as 'f' is interpreted to mean the list of TableCell elements. This PR ensures that we support setF/getF and use that codepath when processing nested records

@chamikaramj chamikaramj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Reuven.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's document why we are special casing "f" for testing here or make this a separate test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the API users should use for writing to fields named "f" ? We should document this in Java docs ? Also, is this fixed for all write methods or just Storage API ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the other write methods create TableRow objects. This one did because it had to convert to protos for Vortex.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also support fields named "f" at top level (not just nested or repeated fields) after this change ? If let's add a test for that as well. If not let's clarify in the documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@chamikaramj chamikaramj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@chamikaramj

Copy link
Copy Markdown
Contributor

Run Java PostCommit

@reuvenlax
reuvenlax merged commit a78fec7 into apache:master Feb 17, 2022
TheNeuralBit pushed a commit to TheNeuralBit/beam that referenced this pull request Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants