Skip to content

neighbor + LowCardinality = wrong result #10333

@den-crane

Description

@den-crane
SELECT
    neighbor(n, -2) AS int,
    neighbor(s, -2) AS str,
    neighbor(lcs, -2) AS lowCstr
FROM
(
    SELECT
        number % 5 AS n,
        toString(n) AS s,
        CAST(s, 'LowCardinality(String)') AS lcs
    FROM numbers(10)
)

┌─int─┬─str─┬─lowCstr─┐
│   0 │     │         │
│   0 │     │         │
│   0 │ 0   │ 0       │
│   1 │ 1   │ 1       │
│   2 │ 2   │ 2       │
│   3 │ 3   │         │
│   4 │ 4   │         │
│   0 │ 0   │ 0       │
│   1 │ 1   │ 1       │
│   2 │ 2   │ 2       │
└─────┴─────┴─────────┘

Metadata

Metadata

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