You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Micah Kornfield (Jira)" <ji...@apache.org> on 2019/10/18 04:22:00 UTC
[jira] [Created] (ARROW-6930) [Java] Create static factory methods
for common array types of testing.
Micah Kornfield created ARROW-6930:
--------------------------------------
Summary: [Java] Create static factory methods for common array types of testing.
Key: ARROW-6930
URL: https://issues.apache.org/jira/browse/ARROW-6930
Project: Apache Arrow
Issue Type: Improvement
Components: Java
Reporter: Micah Kornfield
There is a lot of verbosity in the construction of Arrays for testing purposes (multiple lines of setSafe(...) or set(...). We should start adding some static factory methods to make test setup clearer and more concise. A strawman proposal for BigIntVector might look like:
static BigIntVector create(String name, BufferAllocator allocator, Long... values).
Usage would be something like:
try (BigIntVector input = BigIntVectorCreate("sample_data", allocator, 1235L, null, 456L),
BigIntVector expected = BigIntVectorCreate("sample_data", allocator, 1L, null, 0L),) {
output = doSomethingWith(input);
assertThat(output).isEqualTo(expected);
}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)