From 4f9a2e99a6ab1bf55b7888c808d374de5ffd28e1 Mon Sep 17 00:00:00 2001 From: zhang2014 Date: Sat, 7 May 2022 23:14:03 +0800 Subject: [PATCH] feat(format): replace state each deserialize --- query/src/formats/format_csv.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/query/src/formats/format_csv.rs b/query/src/formats/format_csv.rs index 373227c56860..257de3b4813a 100644 --- a/query/src/formats/format_csv.rs +++ b/query/src/formats/format_csv.rs @@ -182,6 +182,7 @@ impl InputFormat for CsvInputFormat { deserializers.push(data_type.create_deserializer(self.min_accepted_rows)); } + let mut state = std::mem::replace(state, self.create_state()); let state = state.as_any().downcast_mut::().unwrap(); let cursor = Cursor::new(&state.memory); let reader: Box = Box::new(BufferReader::new(cursor));