Skip to content

sql: vectorized engine incorrectly formats interval output #83094

@rytaft

Description

@rytaft

Consider the following difference between the vectorized engine and the row engine:

demo@127.0.0.1:26257/defaultdb> CREATE TABLE t (t1 timestamptz, t2 timestamptz);
CREATE TABLE


Time: 5ms total (execution 5ms / network 0ms)

demo@127.0.0.1:26257/defaultdb> INSERT INTO t VALUES ('2032-08-15 21:25:37.000993+00:00', '2010-10-07 06:38:15.000078+00:00');
INSERT 0 1


Time: 6ms total (execution 6ms / network 0ms)

demo@127.0.0.1:26257/defaultdb> SELECT (t1 - t2) FROM t;
       ?column?
-----------------------
  191606:47:22.000915
(1 row)


Time: 4ms total (execution 3ms / network 1ms)

demo@127.0.0.1:26257/defaultdb> SET vectorize = off;
SET


Time: 0ms total (execution 0ms / network 0ms)

demo@127.0.0.1:26257/defaultdb> SELECT (t1 - t2) FROM t;
          ?column?
-----------------------------
  7983 days 14:47:22.000915
(1 row)

The result with vectorize=off is what is also returned by Postgres.

Jira issue: CRDB-16860

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions