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

[Client v2] illegal argument exception for tuple in array #1889

Conversation

Am-phi
Copy link
Contributor

@Am-phi Am-phi commented Oct 27, 2024

Summary

When an tuple is nested inside an array an illegalArgumentException is returned when reading the value. This is related with the fact that Tuple are considered as a List from a ClickhouseDataType point of view, however tuples are read as Object[], thus when trying to create a ClickhouseArray, we try to insert a Object[] into a List[] which leads to this exception.
This should resolve #1882

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@Am-phi
Copy link
Contributor Author

Am-phi commented Oct 27, 2024

This solution might look a bit hacky. However the 2 other solutions that I see are to change the javaClass for the tuple in the ClickhouseDataTypeEnum, or to change the return type of readValue for tuples from Object[] to List. However, I'm afraid that both might be a possible breaking change for users who have been using this.

@chernser
Copy link
Contributor

@Am-phi Thank you for the contribution!

@chernser chernser merged commit 54cb400 into ClickHouse:main Oct 28, 2024
55 of 59 checks passed
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] "java.lang.IllegalArgumentException: array element type mismatch" for groupUniqArray with Tuple
2 participants