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

PHOENIX-4864 Fix NullPointerException while Logging some DDL Statements #336

Closed
wants to merge 1 commit into from

Conversation

ashuparekh
Copy link
Contributor

Fixed the error. Still to add corresponding test case. @vincentpoon @karanmehta93

@@ -45,7 +45,9 @@ public ResultSet executeQuery() throws SQLException {

@Override
public ResultSet getResultSet() throws SQLException {
return new LoggingPhoenixResultSet(super.getResultSet(), phoenixMetricsLog, sql);
ResultSet resultSet = super.getResultSet();
return (resultSet == null) ? null : new LoggingPhoenixResultSet(super.getResultSet(),
Copy link
Member

Choose a reason for hiding this comment

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

This is still a bug. super.getResultSet() call is not idempotent. You should replace this with resultSet local variable

@ashuparekh ashuparekh force-pushed the 4.x-HBase-1.4 branch 2 times, most recently from 8ab0d00 to f2e3fdd Compare August 24, 2018 20:54
@ashuparekh
Copy link
Contributor Author

Added the corresponding test case. @vincentpoon @karanmehta93

mutationWriteMetricsMap.size() == 0);
assertTrue("Mutation read metrics are not logged again.",
mutationReadMetricsMap.size() == 0);
assertTrue("Mutation write metrics are not logged again.", mutationWriteMetricsMap.size()
Copy link
Member

Choose a reason for hiding this comment

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

nit: unnecessary diff (in lot of places)

@@ -32,6 +35,7 @@

import static org.junit.Assert.assertTrue;


Copy link
Member

Choose a reason for hiding this comment

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

nit

@@ -45,7 +45,9 @@ public ResultSet executeQuery() throws SQLException {

@Override
public ResultSet getResultSet() throws SQLException {
return new LoggingPhoenixResultSet(super.getResultSet(), phoenixMetricsLog, sql);
ResultSet resultSet = super.getResultSet();
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a comment that call to getResultSet() is not idempotent. Hence we cache and return accordingly.

@karanmehta93
Copy link
Member

Nice test coverage @ashuparekh
This PR is almost good to go!

@ashuparekh
Copy link
Contributor Author

@karanmehta93 Incorporated the above suggestions

@stoty
Copy link
Contributor

stoty commented Aug 1, 2023

Already merged.

@stoty stoty closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants