[MDEV-31070] PIVOT table incorrectly formed Created: 2023-04-18 Updated: 2023-05-22 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.6.12 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Matteo Tassinari | Assignee: | Andrew Hutchings |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 22.04 |
||
| Attachments: |
|
| Description |
|
Given a sort of EAV table with the attached data, I tried defining a PIVOT table to transform the `campo` in actual columns, where the value would be `valore`, and the remaning `id_*` fields would be the remaning key fields as CREATE OR REPLACE TABLE my_pivot_table However this produces the wrong structure, as seen in the second sheet of attached data. Here you see the `id_*` fields are repeated for each field determined by `campo`, and each rows populates only one field, leaving the others empty, while I would have expected a single row with all the fields populated. I think the table definition is incorrect, hence this appears to be a problem in the connect engine itself. |
| Comments |
| Comment by Matteo Tassinari [ 2023-04-18 ] |
|
I attached the original and pivoted data as Excel file as I was not able to properly format the table directly in the bug description, sorry for that. |