docs: fix Enum8/Enum16 type mappings in TYPES.md#1930
Conversation
Enum8 and Enum16 were shown as mapping to orb.Point / orb.Ring
because the geo columns shifted when Enum headers were added
without updating row cells.
- Realign Point/Ring/Polygon/etc. X marks under the correct columns
- Document string (and int/int8/int16/fmt.Stringer for Append) support
for Enum types, matching lib/column/enum{8,16}.go
- Mark sql.Scanner Scan support for Enum8/Enum16
Fixes ClickHouse#1901
| | int64 | | | | | | | | | | | | | | | X | | | | | | | | X | X | | | | | | | | | | | | ||
| | int32 | | | | | | | | | | | | | | X | | | | | | | | | | | | | | | | | | | | | | ||
| | int16 | | | | | | | | | | | | | X | | | | | | | | | | | | | X | | X | | | | | | | | ||
| | int8 | | | | | | | | | | | | X | | | | | | | | | | | | | X | | X | | | | | | | | |
There was a problem hiding this comment.
The Time/Time64 columns accept only time.Duration/*time.Duration (plus driver.Valuer) — see lib/column/time.go:117 (AppendRow) and :74 (Append). Appending an int8, int16, or string returns a ColumnConverterError, so these marks are wrong:
int8 → Time(this line) andint16 → Time64(line 22) — the Scan-table rows correctly leave these blank, which confirms the Append marks are stray.string → Time/Time64(line 26).
These are pre-existing on main and likely the same misalignment #1901 fixes (the Time/Time64 columns were inserted without shifting data cells). The correct Enum8/Enum16 marks are already present on these rows, so just drop the Time/Time64 marks.
🤖 Claude reviewDocs-only PR realigning the two type-mapping tables in The core fix is correct. I traced the pipe-delimited cell alignment of both tables. The geo rows ( One issue: the realignment preserves incorrect Blind spots:
Verdict: Inline comments are attached to the relevant lines. This summary updates in place on re-review. |
Summary
Fixes #1901
Fixes incorrect Go type mappings for ClickHouse
Enum8/Enum16inTYPES.md.Enum8was documented as converting toorb.Point(and other geo rows were similarly shifted), whilelib/column/enum8.go/enum16.goactually map enums to string on scan and accept string / integer /fmt.Stringeron append.Root cause
Enum8andEnum16columns were added to the table headers without inserting matching empty cells in data rows, so existing geoXmarks landed two columns left (under the Enum columns).Changes
orb.Point/Ring/Polygon/MultiPolygon/LineString/MultiLineStringmarks under the correct ClickHouse type columnsstring,int,int8(Enum8),int16(Enum16),fmt.Stringerstring,sql.ScannerChecklist