| 154 | } |
| 155 | |
| 156 | VectorPtr createRow(int32_t numRows, bool withNulls) { |
| 157 | auto childType = |
| 158 | ROW({"child_bigint", "child_string"}, {BIGINT(), VARCHAR()}); |
| 159 | auto parentType = |
| 160 | ROW({"parent_bigint", "parent_row"}, {BIGINT(), childType}); |
| 161 | auto baseRow = BaseVector::create(parentType, numRows, pool()); |
| 162 | auto row = baseRow->as<RowVector>(); |
| 163 | EXPECT_EQ(row->size(), numRows); |
| 164 | EXPECT_EQ(row->nulls(), nullptr); |
| 165 | |
| 166 | std::vector<VectorPtr> nested = { |
| 167 | createScalar<TypeKind::BIGINT>(BIGINT(), numRows, withNulls), |
| 168 | createScalar<TypeKind::VARCHAR>(VARCHAR(), numRows, withNulls)}; |
| 169 | auto childRow = std::make_shared<RowVector>( |
| 170 | pool(), |
| 171 | childType, |
| 172 | BufferPtr(nullptr), |
| 173 | numRows, |
| 174 | std::move(nested), |
| 175 | 0 /*nullCount*/); |
| 176 | BufferPtr nulls; |
| 177 | if (withNulls) { |
| 178 | nulls = allocateNulls(numRows, pool()); |
| 179 | auto rawNulls = nulls->asMutable<uint64_t>(); |
| 180 | for (int32_t i = 0; i < numRows; ++i) { |
| 181 | bits::setNull(rawNulls, i, i % 8 == 0); |
| 182 | } |
| 183 | } |
| 184 | std::vector<VectorPtr> parentFields = { |
| 185 | createScalar<TypeKind::BIGINT>(BIGINT(), numRows, withNulls), childRow}; |
| 186 | return std::make_shared<RowVector>( |
| 187 | pool(), |
| 188 | parentType, |
| 189 | nulls, |
| 190 | numRows, |
| 191 | std::move(parentFields), |
| 192 | BaseVector::countNulls(nulls, numRows)); |
| 193 | } |
| 194 | |
| 195 | int32_t createRepeated( |
| 196 | int32_t numRows, |
nothing calls this directly
no test coverage detected