Skip to content

Conversation

Paultagoras
Copy link
Contributor

@Paultagoras Paultagoras commented Feb 14, 2025

Summary

  • Send null when we have null primitives and a nullable column

Closes #2122

Checklist

Delete items not relevant to your PR:

  • Closes #
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@Paultagoras Paultagoras self-assigned this Feb 14, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@chernser
Copy link
Contributor

@Paultagoras would you please add a test for JDBC to check that we are getting null? I remember it has separate class or so.
Also no Array(Nullable(Int32)) test case.


private static void serializePrimitiveData(OutputStream stream, Object value, ClickHouseColumn column) throws IOException {
//Handle null values
if (value == null && column.isNullable()) {//Only nullable columns can have null values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it null and not nullable should we throw an exception like data is not valid

Copy link
Contributor Author

@Paultagoras Paultagoras Feb 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered doing that, but apparently there's logic for some of the data types that would then fail (like the new dynamic stuff) 🫠

@chernser chernser merged commit 8601c02 into main Feb 15, 2025
20 of 25 checks passed
@chernser chernser deleted the resolve-null-dtos branch February 15, 2025 04:32
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 this pull request may close these issues.

[client-v2] Error when inserting DTOs with null value representing Nullable(Int) field of Tuple or Array
3 participants