Merge pull request #62693 from Avogar/mark-variant-comparable

Mark DataTypeVariant as comparable
This commit is contained in:
Kruglov Pavel 2024-04-18 22:30:18 +00:00 committed by GitHub
commit d844a1fc57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,7 @@ public:
bool equals(const IDataType & rhs) const override;
bool isParametric() const override { return true; }
bool isComparable() const override { return true; }
bool haveSubtypes() const override { return true; }
bool textCanContainOnlyValidUTF8() const override;
bool haveMaximumSizeOfValue() const override;

View File

@ -0,0 +1,4 @@
1 str_1
1 str_2
1 1
1 2

View File

@ -0,0 +1,7 @@
set allow_experimental_variant_type=1;
drop table if exists test;
create table test (id UInt64, v Variant(UInt64, String)) engine=MergeTree order by (id, v);
insert into test values (1, 1), (1, 'str_1'), (1, 2), (1, 'str_2');
select * from test;
drop table test;