You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE external_projects ( id Variant(UUID, UInt32, String), name String) Engine=MergeTree ORDER BY ()
Binary Encoded as: [ord number of type from definition when types are sorted alphabetically (String = 0)][... encoded value of selected type]
This type is similar to Tuple, but only one value is present at a time. Variants can be accessed by sub column names. This should be implemented as ability of ClickHouseBinaryReader:
// for query select id, name from external_projects
String id = reader.getString("id.String"); // should return string value or throw exception that value missing or null if nullable column
String id = reader.getInteger("id.String"); // should throw exception about type mismatch even if column is nullable
There should be possibility to get variant type. This requires to add getValueType method.
When encoding POJO:
Most suitable type is selected
Numbers are not converted to strings
Strings not converted to DateTime values and vice versa
Description
Variant type example definition:
Binary Encoded as:
[ord number of type from definition when types are sorted alphabetically (String = 0)][... encoded value of selected type]
This type is similar to Tuple, but only one value is present at a time.
Variants can be accessed by sub column names. This should be implemented as ability of
ClickHouseBinaryReader
:There should be possibility to get variant type. This requires to add
getValueType
method.When encoding POJO:
Variant Type Documentation
The text was updated successfully, but these errors were encountered: