Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSV: first row handled incorrectly if contains an empty string #139

Open
mil opened this issue Sep 23, 2024 · 1 comment
Open

VSV: first row handled incorrectly if contains an empty string #139

mil opened this issue Sep 23, 2024 · 1 comment

Comments

@mil
Copy link

mil commented Sep 23, 2024

The vsv extension seems to handle CSV data incorrectly for the first row if there are any empty column values in that row itself.

For example - save as mock_broken.csv:

a,b,c,d
,,,lastcol
foo,bar,baz,bill

and load as:

.load ./vsv
create virtual table tblfoo using vsv(
  header=1,
  filename='mock_broken.csv'
);
.headers on
select * from tblfoo

will yield:

a|b|c|d
lastcol|||
foo|bar|baz|bill

Note that if rows 2/3 are swapped in mock_broken.csv you get the correct result for the row with empty values and the lastcol value is in the 'd' column as it should be. So this is a bug specifically with the first row containing empty values for CSV parsing in the vsv extension.

@mil
Copy link
Author

mil commented Sep 29, 2024

More details: issue seems specific to vsv's handling of CSVs. The stock csv.c from sqlite doesn't exhibit this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant