| 305 | |
| 306 | |
| 307 | cudf::io::table_with_metadata abstractsql_parser::read_sql(void *src, |
| 308 | const std::vector<int> &column_indices, |
| 309 | const std::vector<cudf::type_id> &cudf_types, |
| 310 | size_t total_rows) |
| 311 | { |
| 312 | auto setup = init(total_rows, column_indices, cudf_types); |
| 313 | std::vector<void*> host_cols = std::move(setup.first); |
| 314 | auto null_masks = std::move(setup.second); |
| 315 | this->read_sql_loop(src, cudf_types, column_indices, host_cols, null_masks); |
| 316 | std::vector<std::unique_ptr<cudf::column>> cudf_cols(host_cols.size()); |
| 317 | |
| 318 | for (int col = 0; col < column_indices.size(); ++col) { |
| 319 | size_t projection = column_indices[col]; |
| 320 | cudf::type_id cudf_type_id = cudf_types[projection]; |
| 321 | switch (cudf_type_id) { |
| 322 | case cudf::type_id::EMPTY: {} break; |
| 323 | case cudf::type_id::INT8: { |
| 324 | std::vector<int8_t> *v = (std::vector<int8_t>*)host_cols[col]; |
| 325 | cudf_cols[col] = build_fixed_width_cudf_col<int8_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 326 | } break; |
| 327 | case cudf::type_id::INT16: { |
| 328 | std::vector<int16_t> *v = (std::vector<int16_t>*)host_cols[col]; |
| 329 | cudf_cols[col] = build_fixed_width_cudf_col<int16_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 330 | } break; |
| 331 | case cudf::type_id::INT32: { |
| 332 | std::vector<int32_t> *v = (std::vector<int32_t>*)host_cols[col]; |
| 333 | cudf_cols[col] = build_fixed_width_cudf_col<int32_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 334 | } break; |
| 335 | case cudf::type_id::INT64: { |
| 336 | std::vector<int64_t> *v = (std::vector<int64_t>*)host_cols[col]; |
| 337 | cudf_cols[col] = build_fixed_width_cudf_col<int64_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 338 | } break; |
| 339 | case cudf::type_id::UINT8: { |
| 340 | std::vector<uint8_t> *v = (std::vector<uint8_t>*)host_cols[col]; |
| 341 | cudf_cols[col] = build_fixed_width_cudf_col<uint8_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 342 | } break; |
| 343 | case cudf::type_id::UINT16: { |
| 344 | std::vector<uint16_t> *v = (std::vector<uint16_t>*)host_cols[col]; |
| 345 | cudf_cols[col] = build_fixed_width_cudf_col<uint16_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 346 | } break; |
| 347 | case cudf::type_id::UINT32: { |
| 348 | std::vector<uint32_t> *v = (std::vector<uint32_t>*)host_cols[col]; |
| 349 | cudf_cols[col] = build_fixed_width_cudf_col<uint32_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 350 | } break; |
| 351 | case cudf::type_id::UINT64: { |
| 352 | std::vector<uint64_t> *v = (std::vector<uint64_t>*)host_cols[col]; |
| 353 | cudf_cols[col] = build_fixed_width_cudf_col<uint64_t>(total_rows, v, null_masks[col], cudf_type_id); |
| 354 | } break; |
| 355 | case cudf::type_id::FLOAT32: { |
| 356 | std::vector<float> *v = (std::vector<float>*)host_cols[col]; |
| 357 | cudf_cols[col] = build_fixed_width_cudf_col<float>(total_rows, v, null_masks[col], cudf_type_id); |
| 358 | } break; |
| 359 | case cudf::type_id::FLOAT64: { |
| 360 | std::vector<double> *v = (std::vector<double>*)host_cols[col]; |
| 361 | cudf_cols[col] = build_fixed_width_cudf_col<double>(total_rows, v, null_masks[col], cudf_type_id); |
| 362 | } break; |
| 363 | case cudf::type_id::BOOL8: { |
| 364 | std::vector<uint8_t> *v = (std::vector<uint8_t>*)host_cols[col]; |
nothing calls this directly
no test coverage detected