| 43 | } |
| 44 | |
| 45 | ArrowSchemaWrapper makeRelSchema(bool includeFrom, bool includeTo, bool weightInt64 = true, |
| 46 | bool fromString = false, bool toInt32 = false, bool includeWeight = true, |
| 47 | bool includeLabel = false) { |
| 48 | int32_t children = 0; |
| 49 | children += includeFrom ? 1 : 0; |
| 50 | children += includeTo ? 1 : 0; |
| 51 | children += includeWeight ? 1 : 0; |
| 52 | children += includeLabel ? 1 : 0; |
| 53 | ArrowSchemaWrapper schema; |
| 54 | createStructSchema(&schema, children); |
| 55 | int64_t idx = 0; |
| 56 | if (includeFrom) { |
| 57 | if (fromString) { |
| 58 | createSchema<std::string>(schema.children[idx], "from"); |
| 59 | } else { |
| 60 | createSchema<int64_t>(schema.children[idx], "from"); |
| 61 | } |
| 62 | ++idx; |
| 63 | } |
| 64 | if (includeTo) { |
| 65 | if (toInt32) { |
| 66 | createSchema<int32_t>(schema.children[idx], "to"); |
| 67 | } else { |
| 68 | createSchema<int64_t>(schema.children[idx], "to"); |
| 69 | } |
| 70 | ++idx; |
| 71 | } |
| 72 | if (includeWeight) { |
| 73 | if (weightInt64) { |
| 74 | createSchema<int64_t>(schema.children[idx], "weight"); |
| 75 | } else { |
| 76 | createSchema<int32_t>(schema.children[idx], "weight"); |
| 77 | } |
| 78 | ++idx; |
| 79 | } |
| 80 | if (includeLabel) { |
| 81 | createSchema<std::string>(schema.children[idx], "label"); |
| 82 | } |
| 83 | return schema; |
| 84 | } |
| 85 | |
| 86 | ArrowSchemaWrapper makeSimpleCsrIndexSchema(bool uint64Child0 = true) { |
| 87 | ArrowSchemaWrapper schema; |
no test coverage detected