-
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: Ignore H2 comparative tests for uppercasing/lowercasing string functions #32604
Conversation
… (which considers the Locale). ES-SQL is, so far, ignoring the Locale. Still, the same queries are executed against ES-SQL alone and results asserted to be correct.
Pinging @elastic/es-search-aggs |
// selectInsertWithLcaseAndLengthWithOrderBy | ||
//SELECT "first_name" origFN, "last_name" origLN, INSERT(UCASE("first_name"),LENGTH("first_name")+1,123,LCASE("last_name")) modified FROM "test_emp" WHERE ASCII("first_name")=65 ORDER BY "first_name" ASC, "last_name" ASC LIMIT 10; | ||
// SELECT "first_name" origFN, "last_name" origLN, INSERT(UCASE("first_name"),LENGTH("first_name")+1,123,LCASE("last_name")) modified FROM "test_emp" WHERE ASCII("first_name")=65 ORDER BY "first_name" ASC, "last_name" ASC LIMIT 10; |
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 instead of commenting them out we could move them into a separate sql-spec file and we can add a logic that will not add them to the list of test here for locales where H2 is messed up.
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.
Yep. Makes sense. I'll make the change.
@@ -0,0 +1,28 @@ | |||
//https://github.com/elastic/elasticsearch/issues/31863 |
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 file should be case_functions.sql-spec
or something and we should include this file in the test case only if we're in a locale the h2 is fine with.
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.
Or, better, we should include them in the test but skip them. I think that is better from a reporting standpoint.
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.
@nik9000 can we use rest blacklist to blacklist them? I think having something like this only with local check would be nice.
Alternatively, something like
if (goodLocale) {
tests.addAll(readScriptSpec("/unsupported.sql-spec", parser));
}
would work as well, it's just I agree with your point about reporting.
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 something like
if (name.startsWith(unsupported)) {
assumeTrue(goodLocale);
}
Would be better. I don't like changing the tests we run based on the locale but I don't mind skipping them based on locale.
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 like it!
test this please |
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.
❤️
…unctions (#32604) Skip the comparative tests using lowercasing/uppercasing against H2 (which considers the Locale). ES-SQL is, so far, ignoring the Locale. Still, the same queries are executed against ES-SQL alone and results asserted to be correct.
ES-SQL is, so far, ignoring the Locale, but we have comparative tests with H2 that are failing because of this.
Still, the same queries are executed against ES-SQL alone and results asserted to be correct.
We should investigate if a Locale should be used for some functions: #32603
Fixes #32589