Skip to content

Conversation

@jorgecarleitao
Copy link
Member

@jorgecarleitao jorgecarleitao commented Jan 21, 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.

@github-actions
Copy link

@jorgecarleitao
Copy link
Member Author

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

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.

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
Copy link
Contributor

@nevi-me nevi-me left a comment

Choose a reason for hiding this comment

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

Very nicely done

@nevi-me nevi-me closed this in 499b6d0 Jan 22, 2021
@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 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.

3 participants