-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19826 Add array_reverse and array_sort functions #11391
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
beikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite good already. I left a couple of comments.
hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java
Outdated
Show resolved
Hide resolved
...rnate-core/src/main/java/org/hibernate/dialect/function/array/AbstractArraySortFunction.java
Outdated
Show resolved
Hide resolved
...rnate-core/src/main/java/org/hibernate/dialect/function/array/AbstractArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/CommonFunctionFactory.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/query/criteria/HibernateCriteriaBuilder.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/type/OracleUserDefinedTypeExporter.java
Outdated
Show resolved
Hide resolved
...te-core/src/main/java/org/hibernate/dialect/function/array/PostgreSQLArraySortEmulation.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/hibernate/dialect/function/array/PostgreSQLArrayReverseEmulation.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/OracleArraySortFunction.java
Outdated
Show resolved
Hide resolved
...te-core/src/main/java/org/hibernate/dialect/function/array/PostgreSQLArraySortEmulation.java
Show resolved
Hide resolved
|
Thanks for the guidance @beikov. |
hibernate-core/src/main/java/org/hibernate/dialect/type/OracleUserDefinedTypeExporter.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/type/OracleUserDefinedTypeExporter.java
Outdated
Show resolved
Hide resolved
beikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also please do the simplifications I proposed across all three emulations?
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/dialect/function/array/H2ArraySortFunction.java
Outdated
Show resolved
Hide resolved
...te-core/src/main/java/org/hibernate/dialect/function/array/PostgreSQLArraySortEmulation.java
Outdated
Show resolved
Hide resolved
Implement array_reverse() and array_sort() with PostgreSQL 18 semantics. Supports PostgreSQL, H2, HSQLDB, Oracle, and CockroachDB with native functions or SQL emulation as appropriate. Signed-off-by: Yoobin Yoon <yunyubin54@gmail.com>
|
@beikov Additionally updated |
|
Great job, thanks! |
|
FYI, we will be merging this PR next week when we branch off for |
Implements
array_reverse()andarray_sort()HQL functions.array_reverse(array)- Returns reversed arrayarray_sort(array [, descending [, nulls_first]])- Returns sorted arrayAll database tests pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-19826