Skip to content

[multistage] UNION queries produces wrong sorting results #11878

@walterddr

Description

@walterddr
SELECT val FROM (
SELECT val, ord FROM (
  SELECT CAST(1 AS INT) AS val, 1 AS ord
  UNION ALL
  SELECT CAST(3 AS INT) AS val, 3 AS ord
)
UNION ALL
SELECT val, ord FROM (
  SELECT CAST(2.1 AS DOUBLE) AS val, 2 AS ord
  UNION ALL
  SELECT CAST(4.1 AS DOUBLE) AS val, 4 AS ord
)
)
ORDER BY ord

throws exception in final order-by comparison b/c of different data type (using either both DOUBLE or both INT are fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working as expectedmulti-stageRelated to the multi-stage query engine

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions