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

Move JDBC warnings to Statement #1640

Merged
merged 6 commits into from
Oct 3, 2019
Merged

Conversation

electrum
Copy link
Member

@electrum electrum commented Oct 2, 2019

The warnings are not specific to the ResultSet.

assertEquals(currentWarnings.size(), 100);

Set<WarningEntry> currentWarnings = getStatementWarnings(statement, queryCreationFuture);
assertThat(currentWarnings).size().isGreaterThanOrEqualTo(PRELOADED_WARNINGS + 1);
Copy link
Member

Choose a reason for hiding this comment

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

assertThat(currentWarnings).size().isGreaterThan(PRELOADED_WARNINGS);

Copy link
Member

Choose a reason for hiding this comment

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

Previously we were checking there were 100 warnings, not we're checking there are at least 6.
I don't know where this 100 came from, but in any case, it would be best to check actual messages of these warnings.

Copy link
Member Author

Choose a reason for hiding this comment

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

The messages are not useful, as they are generated in TestingWarningCollector by rendering the warning code. However, the code and message are compared for uniqueness via the WarningEntry wrapper which is then inserted into a Set.

The previous test code was confusing and didn't really test what we wanted, which is to ensure that warnings show up as the query is running. I rewrote the code to directly test that.

@electrum
Copy link
Member Author

electrum commented Oct 2, 2019

@findepi thanks for the review. I updated/rewrote the PR

@electrum electrum merged commit 3bcda70 into trinodb:master Oct 3, 2019
@electrum electrum deleted the jdbc-warnings branch October 3, 2019 22:16
@electrum electrum mentioned this pull request Oct 5, 2019
6 tasks
@martint martint added this to the 320 milestone Oct 5, 2019
@findepi findepi added the jdbc Relates to Trino JDBC driver label Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

3 participants