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

ARROW-11820: [Rust] Added macro to create native types #9597

Closed
wants to merge 1 commit into from

Conversation

elferherrera
Copy link
Contributor

This adds a macro called creative_native to avoid DRY in the creation of native types for alloc module

@github-actions
Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on JIRA?
https://issues.apache.org/jira/browse/ARROW

Then could you also rename pull request title in the following format?

ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}

See also:

@elferherrera elferherrera changed the title [Rust] Added macro to create native types ARROW-11820: [Rust] Added macro to create native types Feb 27, 2021
@github-actions
Copy link

Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

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

LGTM pending CI, thanks @elferherrera

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me as well -- thanks @elferherrera

It also has the nice benefit that now the rust native type -> Arrow datatype mapping are clearer (e.g. i64 --> Int64, Date64, Time64, Timestamp)

data_type == &DataType::UInt32
}
macro_rules! create_native {
($native_ty:ty,$($impl_pattern:pat)|+) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Today I learned about :pat!

@alamb
Copy link
Contributor

alamb commented Mar 13, 2021

Sorry that I didn't see this one previously

@alamb alamb closed this in 84bf2b8 Mar 13, 2021
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
This adds a macro called creative_native to avoid DRY in the creation of native types for alloc module

Closes apache#9597 from elferherrera/dry-natives

Authored-by: Fernando Herrera <fernando.elizalde@revolut.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
michalursa pushed a commit to michalursa/arrow that referenced this pull request Jun 13, 2021
This adds a macro called creative_native to avoid DRY in the creation of native types for alloc module

Closes apache#9597 from elferherrera/dry-natives

Authored-by: Fernando Herrera <fernando.elizalde@revolut.com>
Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

None yet

3 participants