elastic / elastic/elasticsearch

SQL: Cannot filter on pivoted column

Open
#80,997 2 comments 0 reactions 0 assignees View on GitHub
:Analytics/SQL >bug Team:Analytics
Dominant language
Java
Stars
77.9k
Forks
26.1k
PR merge metrics
PR metrics pending

Description

The query `SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('M' as m, 'F' as f)) WHERE m > 0` yields no results even though there are 6 rows with `m > 0` for the same query without the `WHERE` clause.

Potentially related: #49159 and #80952

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.