timsaucer opened a new pull request, #12846:
URL: https://github.com/apache/datafusion/pull/12846
## Which issue does this PR close?
Closes #12574
## Rationale for this change
This macro allows for easy creation of a record batch, useful for prototype
and unit testing. A user requested this feature.
## What changes are included in this PR?
Adds a macro to create a record batch. For example, the following creates a
record batch with three arrays, a non nullable Int32, a nullable Float64, and a
non nullable String.
```
let batch = create_batch!(
("a", Int32, vec![1, 2, 3]),
("b", Float64, vec![Some(4.0), None, Some(5.0)]),
("c", Utf8, vec!["alpha", "beta", "gamma"])
)?;
```
## Are these changes tested?
Tested both in the provided unit test and locally.
## Are there any user-facing changes?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]