Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite types are handled incorrectly (the solution is presented) #36415

Closed
ask9 opened this issue Nov 30, 2024 · 4 comments · Fixed by #36433, #36438 or dbeaver/cloudbeaver#3137
Closed
Assignees
Milestone

Comments

@ask9
Copy link

ask9 commented Nov 30, 2024

Description

0000005853.mp4

Actual query:

SELECT "f.title", COUNT(*) FROM (
select f
from film as f
) src
GROUP BY "f.title"

Expected query:

SELECT (src.f).title, COUNT(*)
FROM (
    select f
    from film as f
) src
GROUP BY (src.f).title

DBeaver Version

Enterprise Edition 24.3.0-202411230022

Operating System

Windows 10

Database and driver

PostgreSQL 16
PostgreSQL JDBC Driver 42.7.4

Steps to reproduce

No response

Additional context

No response

@ask9
Copy link
Author

ask9 commented Nov 30, 2024

The similar issue appears with Filter by value:

0000005855.mp4

Actual query:

SELECT * FROM (
select f
from film as f

) z_q WHERE f.title IN ('Grosse Wonderful')

Expected query:

SELECT *
FROM (
    select f
    from film as f
) z_q
WHERE (z_q.f).title IN ('Grosse Wonderful')

@ask9
Copy link
Author

ask9 commented Nov 30, 2024

If you have automated tests, I suggest adding additional test case for queries with composite types for all existing features.

@E1izabeth E1izabeth added this to the 24.3.2 milestone Dec 2, 2024
@E1izabeth
Copy link
Member

Thanks for the bug report

@E1izabeth
Copy link
Member

Also if I put the cursor on Filter option in the context menu, I get exception
image

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at org.jkiss.dbeaver.model.impl.jdbc.data.JDBCCollection.makeArrayString(JDBCCollection.java:147)
	at org.jkiss.dbeaver.model.impl.jdbc.data.JDBCCollection.toString(JDBCCollection.java:128)
	at org.jkiss.dbeaver.model.impl.data.formatters.NumberDataFormatter.formatValue(NumberDataFormatter.java:143)
	at org.jkiss.dbeaver.model.impl.jdbc.data.handlers.JDBCNumberValueHandler.getValueDisplayString(JDBCNumberValueHandler.java:85)
	at org.jkiss.dbeaver.ui.controls.resultset.FilterByAttributeAction.translateFilterPattern(FilterByAttributeAction.java:64)
	at org.jkiss.dbeaver.ui.controls.resultset.FilterByAttributeAction.<init>(FilterByAttributeAction.java:36)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer.fillFiltersMenu(ResultSetViewer.java:3453)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer.lambda$fillContextMenu$24(ResultSetViewer.java:2799)
	at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:338)
	at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:467)

@serge-rider serge-rider modified the milestones: 24.3.2, 24.3.1 Dec 2, 2024
serge-rider added a commit that referenced this issue Dec 2, 2024
@serge-rider serge-rider linked a pull request Dec 2, 2024 that will close this issue
serge-rider added a commit that referenced this issue Dec 2, 2024
@serge-rider serge-rider reopened this Dec 2, 2024
serge-rider added a commit that referenced this issue Dec 3, 2024
@serge-rider serge-rider assigned E1izabeth and unassigned serge-rider Dec 3, 2024
@serge-rider serge-rider linked a pull request Dec 3, 2024 that will close this issue
E1izabeth added a commit that referenced this issue Dec 13, 2024
E1izabeth added a commit to dbeaver/cloudbeaver that referenced this issue Dec 13, 2024
@serge-rider serge-rider added check:cloudbeaver Requires Cloudbeaver testing check:autotests labels Dec 14, 2024
@uslss uslss self-assigned this Dec 16, 2024
serge-rider added a commit that referenced this issue Dec 17, 2024
* #36415 Composite types in custom SQL

* #36415 Fix columns of context bound types for postgresql table

* #36415 Add support for composite values to the grouping panel

* #36415 Fix grouping panel usage when column of composite type with nested composite type is filtered

---------

Co-authored-by: Elizabeth <[email protected]>
Co-authored-by: Elizabeth <[email protected]>
Co-authored-by: Diana <[email protected]>
serge-rider pushed a commit to dbeaver/cloudbeaver that referenced this issue Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment