Skip to content

Tuples can be used in ORDER BY but cannot be directly compared when engine is MergeTree #7176

@Dlougach

Description

@Dlougach

To reproduce: server 19.14.3.3 with CLI client.

2177cc704f03 :) CREATE TABLE T2( a Tuple(DateTime, Int32)) ENGINE = MergeTree() ORDER BY a;

CREATE TABLE T2
(
    `a` Tuple(DateTime, Int32)
)
ENGINE = MergeTree()
ORDER BY a

Ok.

0 rows in set. Elapsed: 0.006 sec.

2177cc704f03 :) INSERT INTO T2 (a) VALUES (('2018-01-01 00:00:00', 1));

INSERT INTO T2 (a) VALUES

Ok.

1 rows in set. Elapsed: 0.003 sec.

2177cc704f03 :) SELECT * FROM T2 WHERE a < tuple(toDateTime('2019-01-01 00:00:00'), 0);

SELECT *
FROM T2
WHERE a < (toDateTime('2019-01-01 00:00:00'), 0)

Received exception from server (version 19.14.3):
Code: 169. DB::Exception: Received from localhost:9000. DB::Exception: Cannot compare std::vector<DB::Field, std::allocator<DB::Field> > with StrongTypedef<std::vector<DB::Field, std::allocator<DB::Field> >, DB::TupleTag>.

0 rows in set. Elapsed: 0.004 sec.

Interestingly enough, when engine is Memory, everything works.

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions