| 142 | } |
| 143 | |
| 144 | void createComplexCsrRelTable(main::Connection& connection, bool withBwd = false, |
| 145 | bool splitIndices = false, bool splitIndptr = false, const std::string& tableName = "csr_knows", |
| 146 | const std::string& nodeTableName = "csr_node") { |
| 147 | std::vector<ArrowArrayWrapper> fwdIndices; |
| 148 | if (splitIndices) { |
| 149 | fwdIndices.push_back(makeCsrEdgeBatch({getFwdEdges()[0], getFwdEdges()[1]})); |
| 150 | fwdIndices.push_back(makeCsrEdgeBatch({getFwdEdges()[2], getFwdEdges()[3]})); |
| 151 | } else { |
| 152 | fwdIndices.push_back(makeCsrEdgeBatch(getFwdEdges())); |
| 153 | } |
| 154 | |
| 155 | std::vector<ArrowArrayWrapper> fwdIndptr; |
| 156 | if (splitIndptr) { |
| 157 | fwdIndptr.push_back(makeIndptrBatch({0, 2, 3})); |
| 158 | fwdIndptr.push_back(makeIndptrBatch({4, 4, 4})); |
| 159 | } else { |
| 160 | fwdIndptr.push_back(makeIndptrBatch({0, 2, 3, 4, 4, 4})); |
| 161 | } |
| 162 | |
| 163 | // This branch only exposes forward CSR arrays; backward scans exercise the fallback path. |
| 164 | (void)withBwd; |
| 165 | auto result = ArrowTableSupport::createRelTableFromArrowCSR(connection, tableName, |
| 166 | nodeTableName, nodeTableName, makeComplexFwdIndicesSchema(), std::move(fwdIndices), |
| 167 | makeComplexIndptrSchema(), std::move(fwdIndptr)); |
| 168 | ASSERT_TRUE(result.queryResult->isSuccess()) << result.queryResult->getErrorMessage(); |
| 169 | } |
| 170 | |
| 171 | } // namespace |
| 172 |
no test coverage detected