File tree Expand file tree Collapse file tree 2 files changed +1
-23
lines changed
common/datasource/src/file_format Expand file tree Collapse file tree 2 files changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ use crate::share_buffer::SharedBuffer;
3737pub struct CsvFormat {
3838 pub has_header : bool ,
3939 pub header : bool ,
40- pub skip_bad_records : bool ,
4140 pub continue_on_error : bool ,
4241 pub delimiter : u8 ,
4342 pub schema_infer_max_record : Option < usize > ,
@@ -95,15 +94,6 @@ impl TryFrom<&HashMap<String, String>> for CsvFormat {
9594 . build ( )
9695 } ) ?;
9796 }
98- if let Some ( skip_bad_records) = value. get ( file_format:: FORMAT_SKIP_BAD_RECORDS ) {
99- format. skip_bad_records = skip_bad_records. parse ( ) . map_err ( |_| {
100- error:: ParseFormatSnafu {
101- key : file_format:: FORMAT_SKIP_BAD_RECORDS ,
102- value : skip_bad_records,
103- }
104- . build ( )
105- } ) ?;
106- }
10797 if let Some ( continue_on_error) = value. get ( file_format:: FORMAT_CONTINUE_ON_ERROR ) {
10898 format. continue_on_error = continue_on_error. parse ( ) . map_err ( |_| {
10999 error:: ParseFormatSnafu {
@@ -131,7 +121,6 @@ impl Default for CsvFormat {
131121 Self {
132122 has_header : true ,
133123 header : false ,
134- skip_bad_records : false ,
135124 continue_on_error : true ,
136125 delimiter : b',' ,
137126 schema_infer_max_record : Some ( file_format:: DEFAULT_SCHEMA_INFER_MAX_RECORD ) ,
@@ -342,7 +331,6 @@ mod tests {
342331 has_header: false ,
343332 continue_on_error: true ,
344333 header: false ,
345- skip_bad_records: false ,
346334 timestamp_format: None ,
347335 time_format: None ,
348336 date_format: None
Original file line number Diff line number Diff line change @@ -437,17 +437,7 @@ impl StatementExecutor {
437437 let mut pending = vec ! [ ] ;
438438
439439 while let Some ( r) = stream. next ( ) . await {
440- let record_batch = match r. context ( error:: ReadDfRecordBatchSnafu ) {
441- Ok ( batch) => batch,
442- Err ( err) => {
443- if let Some ( csv_format) = csv_format_opt
444- && csv_format. skip_bad_records
445- {
446- continue ;
447- }
448- return Err ( err) ;
449- }
450- } ;
440+ let record_batch = r. context ( error:: ReadDfRecordBatchSnafu ) ?;
451441 let vectors =
452442 Helper :: try_into_vectors ( record_batch. columns ( ) ) . context ( IntoVectorsSnafu ) ?;
453443
You can’t perform that action at this time.
0 commit comments