Amazon PIVOT bug? "column does not exist"

0

I'm trying to use the Amazon PIVOT feature and am encountering what appears to be a bug. See minimal query and output below:

> WITH t1 AS (select 1 as a) select 1 from t1 PIVOT (sum(a) for a in (1)) WHERE ('NaN'::FLOAT = 0);
ERROR:  Query unsupported due to an internal error.
DETAIL:  SQL reparse error.
CONTEXT:  column "nan" does not exist in unnamed_pivot1.

The literals in the where clause don't have anything to do with the pivot, so the error message does not seem accurate. Is this indeed a bug? Please let me know if I can provide any further information. Thanks!

mdrach
질문됨 2년 전1063회 조회
1개 답변
-1

The literal in the where clause is the problem. The query can't be parsed because there isn't a column named "nan".

Are you trying to check for null with "nan"?

profile pictureAWS
전문가
답변함 2년 전
  • Sorry, not sure I understand your question. Here's a query that gives the output that I expect. The WHERE clause has nothing to do with the rest of the query in the OP or in this example.

    WITH t1 AS (select 1 as a) select 1 from t1 PIVOT (sum(a) for a in (1)) WHERE ('hello' = 'world');
     ?column?
    ----------
    (0 rows)
    

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠