ClickHouse / ClickHouse/clickhouse-cpp

Can't cast from Nullable(UInt64)

オープン
#368 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
C
スター
382
フォーク
209
平均マージ
2日 19時間
マージ済み PR(30日)
14

説明

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!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by examining the AsStrict> expression and compare it with the working ColumnNullable IsNull and GetItem calls shown in the issue. Check the nullable column and casting APIs to determine whether std::optional is supported; done means the requested access path works or its supported limitation is clearly documented.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
databases
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。