| 37 | } |
| 38 | |
| 39 | std::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 | |
| 78 | void 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++) { |
nothing calls this directly
no test coverage detected