Adding support for Union All in IncrementGenerator
Description
Activity
Show:
Andrea Boriero
changed the StatusJanuary 18, 2024 at 1:38 PMResolved
Closed
Christian Beikov
changed the StatusDecember 19, 2023 at 7:30 PMWaiting for review
Resolved
Christian Beikov
updated the Fix versionsDecember 19, 2023 at 7:30 PMNone
6.4.2
Christian Beikov
updated the ResolutionDecember 19, 2023 at 7:30 PMNone
Fixed
Automation for Jira
changed the StatusOctober 17, 2023 at 9:02 AMOpen
Waiting for review
Ankit Agarwal
updated the DescriptionOctober 17, 2023 at 7:43 AMUnion All is already supported for dialects that supports them as per [this|https://github.com/hibernate/hibernate-orm/blob/6e727b6fe46fc2bf22e17eb4eeaa5d9903e5f1df/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java#L512] but seems like it was missed [here|https://github.com/hibernate/hibernate-orm/blob/7665caab1cb99e9d2a76578dedb5376fb53cb5b9/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java#L131] to be added.
This is leading to test failing in [UnionSubclassTest|https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/test/java/org/hibernate/orm/test/unionsubclass2/UnionSubclassTest.java] for Spanner dialect
Union All is already supported for dialects that supports them as per [this|https://github.com/hibernate/hibernate-orm/blob/6e727b6fe46fc2bf22e17eb4eeaa5d9903e5f1df/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java#L512] but seems like it was missed [here|https://github.com/hibernate/hibernate-orm/blob/7665caab1cb99e9d2a76578dedb5376fb53cb5b9/hibernate-core/src/main/java/org/hibernate/id/IncrementGenerator.java#L131] to be added.
This is leading to test failing in [UnionSubclassTest|https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/test/java/org/hibernate/orm/test/unionsubclass2/UnionSubclassTest.java] for Spanner dialect with the following exception
{noformat}Caused by: com.google.cloud.spanner.SpannerException: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Syntax error: Expected keyword ALL or keyword DISTINCT but got keyword SELECT [at 1:68]
...mx) from ( select max(bid) as mx from humans union select max(bid) as mx f...
^ - Statement: 'select max(ids_.mx) from ( select max(bid) as mx from humans union select max(bid) as mx from aliens union select max(bid) as mx from employees ) ids_'{noformat}
Ankit Agarwal
updated the ComponentsOctober 17, 2023 at 7:42 AMNone
query-hql
Ankit Agarwal
changed the AssigneeOctober 17, 2023 at 7:41 AMUnassigned
Ankit Agarwal
Ankit Agarwal
created the IssueOctober 17, 2023 at 7:41 AM
Union All is already supported for dialects that supports them as per this but seems like it was missed here to be added.
This is leading to test failing in UnionSubclassTest for Spanner dialect with the following exception
Caused by: com.google.cloud.spanner.SpannerException: INVALID_ARGUMENT: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Syntax error: Expected keyword ALL or keyword DISTINCT but got keyword SELECT [at 1:68] ...mx) from ( select max(bid) as mx from humans union select max(bid) as mx f... ^ - Statement: 'select max(ids_.mx) from ( select max(bid) as mx from humans union select max(bid) as mx from aliens union select max(bid) as mx from employees ) ids_'