Changeset: a5109d2964c5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/a5109d2964c5 Added Files: sql/test/file_loader/Tests/cars_empty_line.csv sql/test/file_loader/Tests/cars_missing_separators.csv Modified Files: sql/test/file_loader/Tests/file_loader_field_separator.test.in Branch: Aug2024 Log Message:
Add test for issue #7604 Extend file_loader() tests with csv data files with fewer field separators or empty lines. diffs (82 lines): diff --git a/sql/test/file_loader/Tests/cars_empty_line.csv b/sql/test/file_loader/Tests/cars_empty_line.csv new file mode 100644 --- /dev/null +++ b/sql/test/file_loader/Tests/cars_empty_line.csv @@ -0,0 +1,6 @@ +2000,"Ford","Focus",1994 +2001,"Honda",, + +2004,"Tesla","S3XY",2019 +2014,"Lightyear","0",2022 + diff --git a/sql/test/file_loader/Tests/cars_missing_separators.csv b/sql/test/file_loader/Tests/cars_missing_separators.csv new file mode 100644 --- /dev/null +++ b/sql/test/file_loader/Tests/cars_missing_separators.csv @@ -0,0 +1,5 @@ +2000,"Ford","Focus",1994 +2001,"Honda",, +2004,"Tesla","S3XY",2019 +2014,"Lightyear","0",2022 +2020,"Volvo" diff --git a/sql/test/file_loader/Tests/file_loader_field_separator.test.in b/sql/test/file_loader/Tests/file_loader_field_separator.test.in --- a/sql/test/file_loader/Tests/file_loader_field_separator.test.in +++ b/sql/test/file_loader/Tests/file_loader_field_separator.test.in @@ -132,3 +132,57 @@ Lightyear 0 2022 +# tests to load incomplete cars (4 columns, 5 rows) data files with missing field separators or empty lines + +query ITTI nosort +select * from file_loader(r'$TSTSRCDIR/cars_missing_separators.csv') as cars(id, brand, model, "year") +---- +2000 +Ford +Focus +1994 +2001 +Honda +NULL +NULL +2004 +Tesla +S3XY +2019 +2014 +Lightyear +0 +2022 +2020 +Volvo +NULL +NULL + +query ITTI nosort +select * from file_loader(r'$TSTSRCDIR/cars_empty_line.csv') as cars(id, brand, model, "year") +---- +2000 +Ford +Focus +1994 +2001 +Honda +NULL +NULL +NULL +NULL +NULL +NULL +2004 +Tesla +S3XY +2019 +2014 +Lightyear +0 +2022 +NULL +NULL +NULL +NULL + _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
