Skip to content

ARROW-11333: [Rust] Generalized creation of empty arrays. - #9281

Closed
jorgecarleitao wants to merge 1 commit into
apache:masterfrom
jorgecarleitao:improve_empty
Closed

ARROW-11333: [Rust] Generalized creation of empty arrays.#9281
jorgecarleitao wants to merge 1 commit into
apache:masterfrom
jorgecarleitao:improve_empty

Conversation

@jorgecarleitao

@jorgecarleitaojorgecarleitao commented Jan 21, 2021

Copy link
Copy Markdown
Member

This PR exposes two new functions:

  • new_empty_array, that creates a new empty ArrayRef (i.e. dynamically typed) of any (primitive or nested) type except Union
  • RecordBatch::new_empty that creates an empty RecordBatch, thereby migrating code from DataFusion.

Since we were using a similar code in array/transform/mod.rs and array_list, this PR ends up removing some code.

@github-actions

Copy link
Copy Markdown

@jorgecarleitao

Copy link
Copy Markdown
MemberAuthor

@ovr, this is what I was trying to express in your PR: we can use ArrayData directly and thereby support arbitrary nested types.

@alambalamb 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.

This looks really awesome @jorgecarleitao -- more features and less code. That is a pretty solid win in my opinion

Thank you!

@jorgecarleitao
jorgecarleitao marked this pull request as ready for review January 21, 2021 18:09

@nevi-menevi-me 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.

Very nicely done

@jorgecarleitao
jorgecarleitao deleted the improve_empty branch January 22, 2021 07:10
kszucs pushed a commit that referenced this pull request Jan 25, 2021
This PR exposes two new functions:
* `new_empty_array`, that creates a new empty `ArrayRef` (i.e. dynamically typed) of any (primitive or nested) type except `Union`
* `RecordBatch::new_empty` that creates an empty `RecordBatch`, thereby migrating code from `DataFusion`.
Since we were using a similar code in `array/transform/mod.rs` and `array_list`, this PR ends up removing some code.
Closes#9281 from jorgecarleitao/improve_empty
Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Signed-off-by: Neville Dipale <nevilledips@gmail.com>
Sign up for freeto 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.

3 participants

@jorgecarleitao@alamb@nevi-me