Skip to content
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

Merged
merged 5 commits into from
Aug 9, 2018

Conversation

astefan
Copy link
Contributor

@astefan astefan commented Aug 3, 2018

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

… (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.
@elasticmachine
Copy link
Collaborator

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

@imotov imotov Aug 3, 2018

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.

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I like it!

@astefan
Copy link
Contributor Author

astefan commented Aug 6, 2018

@nik9000 @imotov good point about skipping the uppercase/lowercase tests instead of just ignoring them. Pushed a new commit.

@astefan
Copy link
Contributor Author

astefan commented Aug 6, 2018

test this please

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@astefan astefan merged commit 6750e15 into elastic:master Aug 9, 2018
astefan added a commit that referenced this pull request Aug 9, 2018
…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.
@colings86 colings86 added the >test Issues or PRs that are addressing/adding tests label Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying >test Issues or PRs that are addressing/adding tests v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants