Skip to content

[multistage] order-by on UNION STRING and INT columns somehow is allowed #11879

@walterddr

Description

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

This query should throw an exception as 2.1 and 4.1 should not be allowed to compare directly against a numeric value (explicit cast is required) but somehow Pinot produces wrong result instead of throwing an exception.

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