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

Method parse_batch

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

Source from the content-addressed store, hash-verified

37}
38
39std::unique_ptr<ral::frame::BlazingTable> abstractsql_parser::parse_batch(
40 ral::io::data_handle handle,
41 const Schema & schema,
42 std::vector<int> column_indices,
43 std::vector<cudf::size_type> row_groups)
44{
45 void *src = nullptr;
46
47 if (type() == DataType::MYSQL) {
48#if defined(MYSQL_SUPPORT)
49 src = handle.sql_handle.mysql_resultset.get();
50#else
51 throw std::runtime_error(
52 "Unsupported MySQL parser for this BlazingSQL version");
53#endif
54 }
55
56 if (type() == DataType::POSTGRESQL) {
57#if defined(POSTGRESQL_SUPPORT)
58 src = handle.sql_handle.postgresql_result.get();
59#else
60 throw std::runtime_error(
61 "Unsupported PostgreSQL parser for this BlazingSQL version");
62#endif
63 }
64
65 if (type() == DataType::SQLITE) {
66#if defined(SQLITE_SUPPORT)
67 src = handle.sql_handle.sqlite_statement.get();
68#else
69 throw std::runtime_error(
70 "Unsupported Sqlite3 parser for this BlazingSQL version");
71#endif
72 }
73
74 return this->parse_raw_batch(
75 src, schema, column_indices, row_groups, handle.sql_handle.row_count);
76}
77
78void abstractsql_parser::parse_schema(ral::io::data_handle handle, ral::io::Schema & schema) {
79 for(int i = 0; i < handle.sql_handle.column_names.size(); i++) {

Callers

nothing calls this directly

Calls 1

parse_raw_batchMethod · 0.95

Tested by

no test coverage detected