-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes support of empty string in CSVs #3837
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
Conversation
|
@manticore-projects At least PostgreSQL and H2 distinguish nulls from empty strings in the following way: After that PR H2 reads both columns as |
|
@ctabin If there are real-world use cases where |
|
Greetings! Please check this details of the original case. I am aware that This caused an exception before which I have fixed. See example #3785 |
|
Do you really need to write numbers with quotes? |
I do not need to, but I have also no control over it since both is allowed and usually "quoting" is the safest option. The problem is not H2, but the CSV spec -- however I think if the spread sheet program can deal with it, H2 must find a way. |
|
Please, add a new configuration option for your change, something like Spreadsheets are not database systems, their columns with numeric or any other formats may still contain strings as well and they don't really have nulls. CSV is used not only with these spreadsheets, some people use them for other purposes. |
|
Hi @katzyn and @manticore-projects, thanks for jumping in. Indeed #3786 introduces a breaking change but since it was accepted, I just wanted to minimize the impact of it and allow to at least give a possible way to keep the old behavior (by explicitly set the option Let me know if you want to rollback #3786 and then implement the |
|
Replaced by #3842 |
Hi,
This is a minor enhancement to #3786 to allow H2 to still write/read empty string if the
nullStringoption is set inCSVREADandCSVWRITEfunctions to be explicitly different from""ornull.Typically, when using MSQL/MARIADB modes, a NULL value is not the same as an empty string (as where for Oracle, an empty string is converted to NULL).