Remove parts of the path after the last filename partition separator. For example, 12_a_part-0.parquet will become 12_a_
| 64 | // Remove parts of the path after the last filename partition |
| 65 | // separator. For example, 12_a_part-0.parquet will become 12_a_ |
| 66 | std::string StripNonPrefix(const std::string& path) { |
| 67 | std::string v; |
| 68 | auto non_prefix_index = path.rfind(kFilenamePartitionSep); |
| 69 | if (non_prefix_index != std::string::npos) { |
| 70 | v = path.substr(0, non_prefix_index + 1); |
| 71 | } |
| 72 | return v; |
| 73 | } |
| 74 | |
| 75 | } // namespace |
| 76 |