| 1794 | public ::testing::TestWithParam<MakeRecordBatch*> {}; |
| 1795 | |
| 1796 | Status MakeDictionaryBatch(std::shared_ptr<RecordBatch>* out) { |
| 1797 | auto f0_type = arrow::dictionary(int32(), utf8()); |
| 1798 | auto f1_type = arrow::dictionary(int8(), utf8()); |
| 1799 | |
| 1800 | auto dict = ArrayFromJSON(utf8(), "[\"foo\", \"bar\", \"baz\"]"); |
| 1801 | |
| 1802 | auto indices0 = ArrayFromJSON(int32(), "[1, 2, null, 0, 2, 0]"); |
| 1803 | auto indices1 = ArrayFromJSON(int8(), "[0, 0, 2, 2, 1, 1]"); |
| 1804 | |
| 1805 | auto a0 = std::make_shared<DictionaryArray>(f0_type, indices0, dict); |
| 1806 | auto a1 = std::make_shared<DictionaryArray>(f1_type, indices1, dict); |
| 1807 | |
| 1808 | // construct batch |
| 1809 | auto schema = ::arrow::schema({field("dict1", f0_type), field("dict2", f1_type)}); |
| 1810 | |
| 1811 | *out = RecordBatch::Make(schema, 6, {a0, a1}); |
| 1812 | return Status::OK(); |
| 1813 | } |
| 1814 | |
| 1815 | // A utility that supports reading/writing record batches, |
| 1816 | // and manually specifying dictionaries. |
no test coverage detected