ClickHouse / ch2rs

Generate Rust structs from ClickHouse rows
22 stars 5 forks source link

Enum cause CANNOT_READ_ALL_DATA #5

Closed DualHappiness closed 11 months ago

DualHappiness commented 1 year ago

clickhouse: 23.8.2.7

ch2rs generate code use #[repr(i8)] for enum, but this case CANNOT_READ_ALL_DATA. by change it to #[repr(u8)] everything is all right. And in document is also u8. Is this a bug?

loyd commented 12 months ago

Hello, can you provide a full example? #[repr(i8)] matches Enum8 in CH, so either you use Enum16 (and it should be generated as #[repr(i16)]) or your schema is broken elsewhere

DualHappiness commented 11 months ago

The mvp can't get same result.