Default Nullable for type or not? #4234
Replies: 4 comments 4 replies
-
For now on: SqlType eg: This may be a little confusing. So I would vote for defaults to be non-nullable data_type, which is the style of ClickHouse & firebolt, then SqlType is compatible with datavalue's datatype. What's your opinion? cc @zhang2014 @BohuTANG @Xuanwo |
Beta Was this translation helpful? Give feedback.
-
I think this is a user experience problem, not a technical problem. |
Beta Was this translation helpful? Give feedback.
-
#4435 Defaults to not null now. |
Beta Was this translation helpful? Give feedback.
-
I prefer nullable default. :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
I am doing the task that supports the nullable group-by, running into some bewilderments. Our database makes the type nullable default, quote
create table t(a UInt64, b UInt32) Engine = Fuse; insert into t(a,b) select if (number % 3 = 1, null, number) as a, number + 3 as b from numbers(10);
from #4079When we do the following query search like
select a from t group by a
,we will use 8 bytes + 1 byte size to store this hash_key. I mean from this simple query, we can infer that all the types will be nullable and cost 1 byte more in the hash key when used as a group by key. Actually, we may not have any non-nullable type any more, unless that we have the type to explictly declare it as nonnullable(type), we lost some flexibility.The other database design (mainly clickhosue):
For me
I just think that we lost some basic non-nullable value type may be not symmetric and it will drag all the hash_methods into the nullable desert. (serielize and deserilize with all the following bitmap).
Quote from
sundyli
doris,mysql,snowflake : nullable default,
clickhouse, firebolt. non-nullable default.
So I launched this disscussion to get more thought into it. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions