MCPcopy Create free account
hub / github.com/BlazingDB/blazingsql / parse_raw_batch

Method parse_raw_batch

engine/src/io/data_parser/sql/AbstractSQLParser.cpp:487–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487std::unique_ptr<ral::frame::BlazingTable> abstractsql_parser::parse_raw_batch(
488 void *src,
489 const Schema & schema,
490 std::vector<int> column_indices,
491 std::vector<cudf::size_type> row_groups,
492 size_t row_count)
493{
494 // DEBUG
495 //std::cout << "PARSING BATCH: " << handle.sql_handle.row_count << "\n";
496
497 if (src == nullptr) { return schema.makeEmptyBlazingTable(column_indices); }
498
499 if(column_indices.size() > 0) {
500 std::vector<std::string> col_names(column_indices.size());
501
502 for(size_t column_i = 0; column_i < column_indices.size(); column_i++) {
503 col_names[column_i] = schema.get_name(column_indices[column_i]);
504 }
505
506 auto result = read_sql(src, column_indices, schema.get_dtypes(), row_count);
507 result.metadata.column_names = col_names;
508
509 auto result_table = std::move(result.tbl);
510 if (result.metadata.column_names.size() > column_indices.size()) {
511 auto columns = result_table->release();
512 // Assuming columns are in the same order as column_indices and any extra columns (i.e. index column) are put last
513 columns.resize(column_indices.size());
514 result_table = std::make_unique<cudf::table>(std::move(columns));
515 }
516
517 return std::make_unique<ral::frame::BlazingTable>(std::move(result_table), result.metadata.column_names);
518 }
519
520 return nullptr;
521}
522
523} /* namespace io */
524} /* namespace ral */

Callers 1

parse_batchMethod · 0.95

Calls 6

makeEmptyBlazingTableMethod · 0.80
sizeMethod · 0.80
get_nameMethod · 0.80
get_dtypesMethod · 0.80
resizeMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected