Skip to content

fix: Disable ordinal select item references#211

Merged
KirillKurdyukov merged 1 commit intoydb-platform:mainfrom
inoorinoor:disable-ordinal-reference
Mar 23, 2026
Merged

fix: Disable ordinal select item references#211
KirillKurdyukov merged 1 commit intoydb-platform:mainfrom
inoorinoor:disable-ordinal-reference

Conversation

@inoorinoor
Copy link
Contributor

@inoorinoor inoorinoor commented Mar 20, 2026

Ydb does not support ordinal as item reference. For example query like select * from table order by 1.
It is documented in https://ydb.tech/docs/en/yql/reference/syntax/select/order_by?version=v25.2.

So in this PR I made supportsOrdinalSelectItemReference to return false, to such queries worked in hibernate.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

supportsOrdinalSelectItemReference by default returns true in abstract dialect class

Issue Number: N/A

What is the new behavior?

overriden supportsOrdinalSelectItemReference function to return false in YdbDialect, so queries with order by 1 and group by 1 are now working.

Other information

https://docs.hibernate.org/orm/7.3/javadocs/org/hibernate/dialect/Dialect.html#supportsOrdinalSelectItemReference()

@KirillKurdyukov KirillKurdyukov merged commit a651337 into ydb-platform:main Mar 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants