Data type classes
There are two data type classes in Kùzu, LogicalType
and PhysicalType
.
LogicalType
Logical type refers to how data is conceptually organized. This type doesn’t handle how data is
actually stored. Different logical types may have the same physical type during storage/query
processing, e.g. both INT32
and DATE
logical type will have INT32
physical type.
During query compilation i.e. parsing, binding and planning, the logical type should always be used.
PhysicalType
Physical type refers to the specific data format as it is physically stored on disk and in memory.
Physical type is useful in storage and query processing, for e.g., columns are constructed based on physical types. Comparison operators can only work on physical types. Using the physical type is not mandatory — if you need to make a distinction between logical types, then you will need to fall back to using a logical type.