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

WIP: Support union types #1011

Merged
merged 7 commits into from
Oct 18, 2019
Merged

Conversation

suminb
Copy link
Contributor

@suminb suminb commented Oct 16, 2019

While working on #982, I've gained some knowledge on how ORC format works. So I might as well implement UnionColumnConverter to support union types.

This is more like a proposal/brainstorming rather than a complete solution. As marked as TODO or FIXME there are some pending tasks as well. Any feedback and discussions are welcomed.

byte mask = 0;

mask |= value.isBoolean() ? BOOLEAN_MASK : 0;
mask |= value.isNumber() ? NUMBER_MASK : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why continuously |=? You can only has one type mask

Copy link
Contributor Author

@suminb suminb Oct 16, 2019

Choose a reason for hiding this comment

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

Thanks for the quick response. When I started working on this, at the beginning I thought for reason that two of the JSON types could co-exist in a single value. I was probably thinking of a case where a JSON value may be either null or not-null (in a sense that both {"key":"value"} and {"key":null} are valid), which clearly does not apply here. That was me being silly. Perhaps I should replace the whole mask stuff with enum.

@suminb suminb force-pushed the feature/union-types branch from a9cb26b to a832d58 Compare October 17, 2019 14:36
@HenryCaiHaiying HenryCaiHaiying merged commit 7033360 into pinterest:master Oct 18, 2019
@HenryCaiHaiying
Copy link
Contributor

lgtm

HenryCaiHaiying added a commit that referenced this pull request Oct 20, 2019
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