-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: interval type not using same comparison as sql equality for aggregation or insertion #79549
Copy link
Copy link
Open
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-typingSQLtype inference, typing rules, type compatibility.SQLtype inference, typing rules, type compatibility.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-2Medium-high impact: many users impacted, risks of availability and difficult-to-fix data errorsMedium-high impact: many users impacted, risks of availability and difficult-to-fix data errorsT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Metadata
Metadata
Assignees
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-typingSQLtype inference, typing rules, type compatibility.SQLtype inference, typing rules, type compatibility.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-2Medium-high impact: many users impacted, risks of availability and difficult-to-fix data errorsMedium-high impact: many users impacted, risks of availability and difficult-to-fix data errorsT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Type
Projects
Status
Bugs to Fix
It appears that the
INTERVALtype is not using the same comparison for SQL equality as for aggregation. These queries illustrate the problem:In PostgreSQL, the two interval values are equal, group together in the same bucket, and count as the same key during insertion. PostgreSQL 14.2:
But in CockroachDB, the two interval values are equal, but do not group together in the same bucket or count as the same key during insertion. CockroachDB v22.1.0-beta.1, same for both vectorized engine and row-based engine:
Jira issue: CRDB-14903
Epic: CRDB-20062