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

CSVRead: Fails to translate empty Numbers, when cells are quoted #3785

Closed
manticore-projects opened this issue Apr 25, 2023 · 7 comments · Fixed by #3786
Closed

CSVRead: Fails to translate empty Numbers, when cells are quoted #3785

manticore-projects opened this issue Apr 25, 2023 · 7 comments · Fixed by #3786

Comments

@manticore-projects
Copy link
Contributor

CSV File `sample.csv'

"Test"
"100.22"
""

Import via CsvRead

CREATE TABLE TEST(TEST DECIMAL(12,2) NULL);
INSERT INTO TEST SELECT * FROM CsvRead('sample.csv');

Will fail at row 2 with

org.h2.jdbc.JdbcSQLDataException: Data conversion error converting "'' (TEST: ""TEST"" DECIMAL(12, 2))";

Reason: the empty String '' is not interpreted as NULL, but instead forwarded to a call of new BigDecimal('') which will fail.

manticore-projects added a commit to manticore-projects/h2database that referenced this issue Apr 25, 2023
CSV Number Columns can have empty Cells, e.g. '' which still need to be 
translated to a Number Column Type. So instead of creating a new Number 
from the empty String (which will fail), a NULL Number must be returned.

fixes h2database#3785
@manticore-projects
Copy link
Contributor Author

Thank you so much for fast round turn.
Please can you publish a new 219 SNAPSHOT? Cheers!

@andreitokar
Copy link
Contributor

Andreas, we've never published snapshots. Where do you expect this artifact to live?
You can build it yourself from the trunk, if you badly need it.

@manticore-projects
Copy link
Contributor Author

Andreas, we've never published snapshots.

Sorry, was not aware.

Where do you expect this artifact to live?

Sonatype? Publishing SNAPSHOT builds is pretty common these days.

    repositories {
        maven {
            name "ossrh"

            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
            def snapshotsRepoUrl= "https://s01.oss.sonatype.org/content/repositories/snapshots/"
            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
            credentials(PasswordCredentials)
        }

You can build it yourself from the trunk, if you badly need it.
Yes, sure. But I publish a software JDBCParquetWriter which depends on it for the test cases and I do not want to start including static libraries.

@manticore-projects
Copy link
Contributor Author

Let me re-phrase: would you accept a PR modifying the build so that Snapshot get published on every commit to Master?

@katzyn
Copy link
Contributor

katzyn commented Apr 27, 2023

@andreitokar
If I remember that well, there were snapshot builds somewhere a long time ago.

We also have some leftovers from it it our build system: ffc00f8

@andreitokar
Copy link
Contributor

Honestly, I have zero interest in doing that. As you might know, we have enough complains, when people switch to another released versions without a proper database upgrade. If you going to use snapshot release, then easy of use, like ability to download pre-built binary, should be the least of your worries. Will this snapshot be compatible with the previous one? What about the next? What went into that snapshot build? Does it have a feature X.
Forcing people to build binaries from git would at least exploit human natural laziness in a futile attempt to avoid that situation. 😃

@manticore-projects
Copy link
Contributor Author

Greetings. I have do not want to argue or annoy you, but it is worth pointing out: Snapshots are published automatically and whenever a change is committed to the Git Master. It takes Zero manual effort.

"What went into that SNAPSHOT BUILD" --> everything committed to GIT Master, the SNAPSHOT bears the (latest) COMMIT ID and is distinct.

Although I understand your point on the DB upgrade and compatibility.

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

Successfully merging a pull request may close this issue.

3 participants