ClickHouse / ClickHouse/clickhouse-cpp
Can't cast from Nullable(UInt64)
- Dominant language
- C
- Stars
- 382
- Forks
- 209
- Avg merge
- 3h 58m
- Merged PRs (30d)
- 12
Description
Hello, everyone!
I try to get a value from Nullable(UInt64) column, and I want to get std::optional as a result, with this code:
```
block[col]->AsStrict>()->At(row);
```
But I have an exception:
```
terminate called after throwing an instance of 'clickhouse::ValidationError'
what(): Can't cast from Nullable(UInt64)
```
I can get a value only this way, and this code works good:
```
if(!block[b_p_b]->AsStrict()->IsNull(row)){
std::cout << block[b_p_b]->AsStrict()->GetItem(row).get() << std::endl;
}
```
But this way is not very good for me, it would be much better if I could get std::optional as a result of this operation.
Please tell me how can I do this?
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.