clickhouse-go icon indicating copy to clipboard operation
clickhouse-go copied to clipboard

Fix tuple append row handling to gracefully accept empty structs.

Open jtmolon opened this issue 1 month ago • 1 comments

Summary

AppendRow fails with conversion error if the value of the tuple field is a nil pointer. This is a problem when inserting from protobuf using optional nested messages, when these are not given a value.

Example error:

clickhouse [AppendRow]: updated_ts clickhouse [AppendRow]: converting *timestamppb.Timestamp to Tuple(seconds Int64, nanos Int32) is unsupported

This change allows for graceful handling of empty structs. Full example here: https://gist.github.com/jtmolon/569f5a37bed17620c4c976baee0eb7ab

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
  • [ ] For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

jtmolon avatar Nov 24 '25 15:11 jtmolon

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 24 '25 15:11 CLAassistant