clickhouse-go
clickhouse-go copied to clipboard
Fix tuple append row handling to gracefully accept empty structs.
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
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.