| 137 | } |
| 138 | |
| 139 | int SubstraitParser::getIdxFromNodeName(const std::string& nodeName) { |
| 140 | // Get the position of "_" in the function name. |
| 141 | std::size_t pos = nodeName.find("_"); |
| 142 | if (pos == std::string::npos) { |
| 143 | BOLT_FAIL("Invalid node name."); |
| 144 | } |
| 145 | if (pos == nodeName.size() - 1) { |
| 146 | BOLT_FAIL("Invalid node name."); |
| 147 | } |
| 148 | // Get the column index. |
| 149 | std::string colIdx = nodeName.substr(pos + 1); |
| 150 | try { |
| 151 | return stoi(colIdx); |
| 152 | } catch (const std::exception& err) { |
| 153 | BOLT_FAIL(err.what()); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | const std::string& SubstraitParser::findFunctionSpec( |
| 158 | const std::unordered_map<uint64_t, std::string>& functionMap, |