| 240 | } |
| 241 | |
| 242 | static void sinkFunc(ExportFuncSharedState& sharedState, ExportFuncLocalState& localState, |
| 243 | const ExportFuncBindData& bindData, std::vector<std::shared_ptr<ValueVector>> inputVectors) { |
| 244 | auto& exportCSVLocalState = localState.cast<ExportCSVLocalState>(); |
| 245 | auto& exportCSVBindData = bindData.constCast<ExportCSVBindData>(); |
| 246 | auto& exportCSVSharedState = sharedState.cast<ExportCSVSharedState>(); |
| 247 | writeRows(exportCSVBindData, exportCSVLocalState, exportCSVSharedState, |
| 248 | std::move(inputVectors)); |
| 249 | auto& serializer = exportCSVLocalState.serializer; |
| 250 | if (serializer->getSize() > ExportCSVConstants::DEFAULT_CSV_FLUSH_SIZE) { |
| 251 | exportCSVSharedState.writeRows(serializer->getBlobData(), serializer->getSize()); |
| 252 | serializer->clear(); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | static void combineFunc(ExportFuncSharedState& sharedState, ExportFuncLocalState& localState) { |
| 257 | auto& serializer = localState.cast<ExportCSVLocalState>().serializer; |