| 416 | }; |
| 417 | |
| 418 | TEST_F(ArrowBridgeArrayExportTest, flatNotNull) { |
| 419 | std::vector<int64_t> inputData = {1, 2, 3, 4, 5}; |
| 420 | ArrowArray arrowArray; |
| 421 | { |
| 422 | // Make sure that ArrowArray is correctly acquiring ownership, even after |
| 423 | // the initial vector shared_ptr is gone. |
| 424 | auto flatVector = vectorMaker_.flatVector(inputData); |
| 425 | bolt::exportToArrow(flatVector, arrowArray, pool_.get(), options_); |
| 426 | } |
| 427 | |
| 428 | EXPECT_EQ(inputData.size(), arrowArray.length); |
| 429 | EXPECT_EQ(0, arrowArray.null_count); |
| 430 | EXPECT_EQ(0, arrowArray.offset); |
| 431 | EXPECT_EQ(0, arrowArray.n_children); |
| 432 | |
| 433 | EXPECT_EQ(nullptr, arrowArray.children); |
| 434 | EXPECT_EQ(nullptr, arrowArray.dictionary); |
| 435 | |
| 436 | // Validate buffers. |
| 437 | EXPECT_EQ(2, arrowArray.n_buffers); // null and values buffers. |
| 438 | EXPECT_EQ(nullptr, arrowArray.buffers[0]); // no nulls. |
| 439 | |
| 440 | const int64_t* values = static_cast<const int64_t*>(arrowArray.buffers[1]); |
| 441 | |
| 442 | for (size_t i = 0; i < inputData.size(); ++i) { |
| 443 | EXPECT_EQ(inputData[i], values[i]); |
| 444 | } |
| 445 | |
| 446 | // Consumers are required to call release. Ensure release and private_data |
| 447 | // are null after releasing it. |
| 448 | arrowArray.release(&arrowArray); |
| 449 | EXPECT_EQ(nullptr, arrowArray.release); |
| 450 | EXPECT_EQ(nullptr, arrowArray.private_data); |
| 451 | } |
| 452 | |
| 453 | TEST_F(ArrowBridgeArrayExportTest, flatBool) { |
| 454 | testFlatVector<bool>({ |
nothing calls this directly
no test coverage detected