Treating the Empty String as NULL since 0.3.2-patch6
See original GitHub issueI can reproduce this misbehaviour since version 0.3.2-patch6.
Up to version 0.3.2-patch5 everything worked fine.
I poked around an bit and found out that the jdbc-driver has problems with empty strings. It seems that it handles empty strings like null values.
Before patch6 everything worked fine. This behavior still exists in patch9
This relates to #896
Unexpected error inserting/updating row in part [insertRow add batch]
…
com.clickhouse.client.data.BinaryStreamUtils.writeString (BinaryStreamUtils.java:1667)
If is replace the empty string value with any character the error is gone.
Issue Analytics
- State:
- Created a year ago
- Comments:28
Top Results From Across the Web
Oracle treating empty string as NULL problem for a Java / JPA ...
No, there is no way to treat empty strings as empty strings. Oracle always treats a string of length zero as a NULL...
Read more >Clover treating empty string "" as null - CloverCARE Support
Hello, you can't set on clover field string with length 0, but you can set blank string (" "). I hope it will...
Read more >Empty String -> Null, Page 1 - LLBLGen Pro
However, this may not continue to be true in future releases, and Oracle recommends that you do not treat empty strings the same...
Read more >Understanding Null Versus the Empty String
In Groovy, there is a subtle difference between a variable whose value is null and a variable whose value is the empty string....
Read more >Everything you wanted to know about $null - PowerShell
If you use $null in a string, then it's a blank value (or empty string). PowerShell. Copy. PS> $value = $null PS> Write-Output...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zhicwu Sorry, But I have a lack of time thees days. I will try this again, but I thought I tested it with different setups
Who do you think, has triggered this? 😃 yes - you are right. It was me …
@mafiore, I tried on hop 2.0.0 and was not able to reproduce the issue.
nullAsDefault
works exactly as expected. Also the exception above will only be thrown when nullAsDefault < 1:https://github.com/ClickHouse/clickhouse-jdbc/blob/ea5aaf579b0612bcf1825eb1ec31bf9b170a7a65/clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/internal/InputBasedPreparedStatement.java#L320-L323
On a side note, it looks like they started to enhance clickhouse plugin by replacing clickhouse4j to official driver, so that nobody has to use generic database plugin to access ClickHouse 😄