-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
SQL: Fix ORDER BY YEAR() function #51562
Changes from 2 commits
34d31f3
94251c9
2aa1aee
1875e76
801ca3e
e50c2fd
88553db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,23 +106,23 @@ SELECT first_name f, last_name l, YEAR(dep.from_date) start FROM test_emp WHERE | |
|
||
f:s | l:s | start:i | ||
|
||
Sreekrishna |Servieres |1985 | ||
Zhongwei |Rosen |1986 | ||
Chirstian |Koblick |1986 | ||
null |Chappelet |1988 | ||
Zvonko |Nyanchama |1989 | ||
Parto |Bamford |1995 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ordering here is completely wrong. 1995, 1986, 1996.... The query has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oooops! I rushed here, sorry, need to check it. Thx for catching! |
||
Chirstian |Koblick |1986 | ||
Duangkaew |Piveteau |1996 | ||
Kazuhide |Peha |1992 | ||
null |Demeyer |1994 | ||
; | ||
|
||
selectWithScalarOnNestedWithoutProjection | ||
SELECT first_name f, last_name l FROM test_emp WHERE dep.dep_name = 'Production' AND languages > 1 ORDER BY YEAR(dep.from_date) LIMIT 5; | ||
|
||
f:s | l:s | ||
|
||
Sreekrishna |Servieres | ||
Zhongwei |Rosen | ||
Chirstian |Koblick | ||
null |Chappelet | ||
Zvonko |Nyanchama | ||
Parto |Bamford | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is not relevant (anymore). Can you add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order can change because previously we would have a strict order on the whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so how does the query dsl look like now? Previously I think it contained a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, since a scalar is used, it needs to be translated into a scripted sorting, which currently is not supported for nested fields. |
||
Chirstian |Koblick | ||
Duangkaew |Piveteau | ||
Kazuhide |Peha | ||
null |Demeyer | ||
; | ||
|
||
// | ||
|
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.
I think the method can be removed entirely - is it used anywhere else?