support Nullable types
part of #18
/assign
I'd like to pick this issue. Is it resolved now?
@Thysinner thanks. No one resolve this. And this issue is a little non-trivial. :pray:
What's your idea about the issue? It will be great if I could continue to make progress on the basis of your ideas.
@Thysinner I mean you may pick up issues by your understanding. There are many good-first-issues or help-wanted issues. However, if you understand this issue, it is still great to make it done. I will help you if you meet problem.
Refer to https://clickhouse.tech/docs/en/sql-reference/data-types/nullable/, the Nullable wrapped data types are restricted. And I saw the TB grammar file has restricted the wrapped data types to simple type and decimal type. So could we assume that the Nullable wrapped data types in the meta data are always valid since the grammar file is forcing users to create valid Nullable columns?
Otherwise, we will always need to check the wrapped data type like this
BqlType::Nullable(bt) => match bt {
BqlType::Int(_)
| BqlType::UInt(_)
| BqlType::Float(_)
| BqlType::DateTime
| BqlType::Date
| BqlType::Decimal(_, _) => bt.size(),
_ => Err(MetaError::InvalidNullableDataType),
}
Which is ugly and likely to consume more CPU
@Thysinner this is not important for prototyping. Just show a primary working PR. Then we can start from that.
Thanks for the suggestion