| 174 | namespace { |
| 175 | |
| 176 | Result<RowTableImpl> MakeRowTableFromExecBatch(const ExecBatch& batch) { |
| 177 | RowTableImpl row_table; |
| 178 | |
| 179 | std::vector<KeyColumnMetadata> column_metadatas; |
| 180 | RETURN_NOT_OK(ColumnMetadatasFromExecBatch(batch, &column_metadatas)); |
| 181 | RowTableMetadata table_metadata; |
| 182 | table_metadata.FromColumnMetadataVector(column_metadatas, sizeof(uint64_t), |
| 183 | sizeof(uint64_t)); |
| 184 | RETURN_NOT_OK(row_table.Init(default_memory_pool(), table_metadata)); |
| 185 | std::vector<uint16_t> row_ids(batch.length); |
| 186 | std::iota(row_ids.begin(), row_ids.end(), 0); |
| 187 | RowTableEncoder row_encoder; |
| 188 | row_encoder.Init(column_metadatas, sizeof(uint64_t), sizeof(uint64_t)); |
| 189 | std::vector<KeyColumnArray> column_arrays; |
| 190 | RETURN_NOT_OK(ColumnArraysFromExecBatch(batch, &column_arrays)); |
| 191 | row_encoder.PrepareEncodeSelected(0, batch.length, column_arrays); |
| 192 | RETURN_NOT_OK(row_encoder.EncodeSelected( |
| 193 | &row_table, static_cast<uint32_t>(batch.length), row_ids.data())); |
| 194 | |
| 195 | return row_table; |
| 196 | } |
| 197 | |
| 198 | Result<RowTableImpl> RepeatRowTableUntil(const RowTableImpl& seed, int64_t num_rows) { |
| 199 | RowTableImpl row_table; |
nothing calls this directly
no test coverage detected