| 1105 | memcpy(rawBuffer, sv.data(), sv.size()); |
| 1106 | rawBuffer += sv.size(); |
| 1107 | newOffset += sv.size(); |
| 1108 | } |
| 1109 | *++rawOffsets = newOffset; |
| 1110 | }); |
| 1111 | BOLT_DCHECK_EQ(bufSize, *rawOffsets); |
| 1112 | } |
| 1113 | |
| 1114 | void exportFlat( |
| 1115 | const BaseVector& vec, |
| 1116 | const Selection& rows, |
| 1117 | const ArrowOptions& options, |
| 1118 | ArrowArray& out, |
| 1119 | memory::MemoryPool* pool, |
| 1120 | BoltToArrowBridgeHolder& holder) { |
| 1121 | out.n_children = 0; |
| 1122 | out.children = nullptr; |
| 1123 | switch (vec.typeKind()) { |
| 1124 | case TypeKind::BOOLEAN: |
| 1125 | case TypeKind::TINYINT: |
| 1126 | case TypeKind::SMALLINT: |
| 1127 | case TypeKind::INTEGER: |
| 1128 | case TypeKind::BIGINT: |
| 1129 | case TypeKind::HUGEINT: |
| 1130 | case TypeKind::REAL: |
| 1131 | case TypeKind::DOUBLE: |
| 1132 | case TypeKind::TIMESTAMP: |
| 1133 | exportValues(vec, rows, options, out, pool, holder); |
| 1134 | break; |
| 1135 | case TypeKind::UNKNOWN: |
| 1136 | if (options.exportToArrowIPC) { |
| 1137 | out.n_buffers = 0; |
| 1138 | } |
| 1139 | break; |
| 1140 | case TypeKind::VARCHAR: |
| 1141 | case TypeKind::VARBINARY: |
| 1142 | if (options.exportToView) { |
| 1143 | exportValues(vec, rows, options, out, pool, holder); |
| 1144 | exportViews( |
| 1145 | *vec.asUnchecked<FlatVector<StringView>>(), |
| 1146 | rows, |
| 1147 | options, |
| 1148 | out, |
| 1149 | pool, |
| 1150 | holder); |
| 1151 | } else if (options.useLargeString) { |
| 1152 | exportStrings<int64_t>( |
| 1153 | *vec.asUnchecked<FlatVector<StringView>>(), |
| 1154 | rows, |
| 1155 | out, |
| 1156 | pool, |
| 1157 | holder); |
| 1158 | } else { |
| 1159 | exportStrings<int32_t>( |
| 1160 | *vec.asUnchecked<FlatVector<StringView>>(), |
| 1161 | rows, |
| 1162 | out, |
| 1163 | pool, |
| 1164 | holder); |
no test coverage detected