EveyWu created CALCITE-6521:
--------------------------------

             Summary: CROSS JOIN UNNEST The results do not match expectations.
                 Key: CALCITE-6521
                 URL: https://issues.apache.org/jira/browse/CALCITE-6521
             Project: Calcite
          Issue Type: Bug
            Reporter:  EveyWu
         Attachments: image-2024-08-08-22-03-13-643.png

{code:java}
SELECT n, a
FROM (
  VALUES
    (ARRAY[2, 5], ARRAY['dog', 'cat', 'bird']),
    (ARRAY[7, 8, 9], ARRAY['cow', 'pig'])
) AS x (numbers, animals)
CROSS JOIN UNNEST(numbers, animals) AS t (n, a);
{code}
Postgres result:
!image-2024-08-08-22-03-13-643.png|width=171,height=157!

 

calcite result:

+---+------+
| N |  A   |
+---+------+
| 2 | dog  |
| 2 | cat  |
| 2 | bird |
| 5 | dog  |
| 5 | cat  |
| 5 | bird |
| 7 | cow  |
| 7 | pig  |
| 8 | cow  |
| 8 | pig  |
| 9 | cow  |
| 9 | pig  |
+---+------+



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to