question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Treating the Empty String as NULL since 0.3.2-patch6

See original GitHub issue

I 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:closed
  • Created a year ago
  • Comments:28

github_iconTop GitHub Comments

1reaction
mafiorecommented, Jun 28, 2022

@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

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 😄

Who do you think, has triggered this? 😃 yes - you are right. It was me …

1reaction
zhicwucommented, Jun 27, 2022

@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 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found