You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2018/06/02 00:33:08 UTC

[Impala-ASF-CR] IMPALA-7110. Fix some warnings from error-prone

Todd Lipcon has uploaded this change for review. ( http://gerrit.cloudera.org:8080/10583


Change subject: IMPALA-7110. Fix some warnings from error-prone
......................................................................

IMPALA-7110. Fix some warnings from error-prone

* Fixes several cases of Preconditions.checkNotNull(<bool>) which were
  ineffective. Instead, we should use Preconditions.checkState.

* Fixed a case of synchronizing on a non-final class member, which is a
  bad practice.

* Fixed a case of trying to stringify an array instead of using Joiner
  to join it to a human-readable representation.

* Fixed a case where the format string in String.format didn't match the
  number of arguments passed.

I elected not to enable error-prone in the maven settings since it
increases compilation time noticeably.

Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
---
M fe/src/main/java/org/apache/impala/analysis/CreateUdfStmt.java
M fe/src/main/java/org/apache/impala/analysis/LiteralExpr.java
M fe/src/main/java/org/apache/impala/analysis/Path.java
M fe/src/main/java/org/apache/impala/catalog/DiskIdMapper.java
M fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
M fe/src/main/java/org/apache/impala/catalog/StructType.java
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
7 files changed, 9 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/10583/1
-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................

IMPALA-7110. Fix errors from error-prone

* Fixes several cases of Preconditions.checkNotNull(<bool>) which were
  ineffective. Instead, we should use Preconditions.checkState.

* Fixed a case of synchronizing on a non-final class member, which is a
  bad practice.

* Fixed a case of trying to stringify an array instead of using Joiner
  to join it to a human-readable representation.

* Fixed a couple cases where the format string in String.format didn't
  match the number of arguments passed.

* Fixed a test where PrimitiveType objects were being used to look up
  elements in a Map<ScalarType, String>. This would always return null,
  so the test was ineffective.

I elected not to enable error-prone in the default maven profile since
it increases compilation time noticeably. It can be enabled by running
'mvn -Perrorprone'.

Even with this patch there are a bunch of warnings -- this only
addresses the issues that errorprone considers "errors".

Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Reviewed-on: http://gerrit.cloudera.org:8080/10583
Reviewed-by: Bharath Vissapragada <bh...@cloudera.com>
Reviewed-by: Philip Zeyliger <ph...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M fe/pom.xml
M fe/src/main/java/org/apache/impala/analysis/CreateUdfStmt.java
M fe/src/main/java/org/apache/impala/analysis/LiteralExpr.java
M fe/src/main/java/org/apache/impala/analysis/Path.java
M fe/src/main/java/org/apache/impala/catalog/DiskIdMapper.java
M fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
M fe/src/main/java/org/apache/impala/catalog/StructType.java
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/hive/executor/UdfExecutorTest.java
11 files changed, 51 insertions(+), 14 deletions(-)

Approvals:
  Bharath Vissapragada: Looks good to me, but someone else must approve
  Philip Zeyliger: Looks good to me, approved
  Impala Public Jenkins: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[Impala-ASF-CR] IMPALA-7110. Fix some warnings from error-prone

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix some warnings from error-prone
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG@21
PS1, Line 21: I elected not to enable error-prone in the maven settings since it
> I'll give this a try, though usually when I attempt to do this kind of thin
turned out to be not that bad to add a profile so I just added to this patch


http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
File fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java:

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java@85
PS1, Line 85: argTypes
> interesting, wonder why it didn't catch this one. Will do.
argTypes is a List, so the built-in toString actually works. My fix down below was on the wrong spot in the line - it was actually complaining about the exception stack trace and I mis-fixed the error.



-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 05 Jun 2018 20:36:03 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................


Patch Set 2:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/2601/


-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 05 Jun 2018 22:18:15 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Philip Zeyliger (Code Review)" <ge...@cloudera.org>.
Philip Zeyliger has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................


Patch Set 2: Code-Review+2

maven profile looks fine.


-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 05 Jun 2018 22:16:38 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Bharath Vissapragada, Philip Zeyliger, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/10583

to look at the new patch set (#2).

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................

IMPALA-7110. Fix errors from error-prone

* Fixes several cases of Preconditions.checkNotNull(<bool>) which were
  ineffective. Instead, we should use Preconditions.checkState.

* Fixed a case of synchronizing on a non-final class member, which is a
  bad practice.

* Fixed a case of trying to stringify an array instead of using Joiner
  to join it to a human-readable representation.

* Fixed a couple cases where the format string in String.format didn't
  match the number of arguments passed.

* Fixed a test where PrimitiveType objects were being used to look up
  elements in a Map<ScalarType, String>. This would always return null,
  so the test was ineffective.

I elected not to enable error-prone in the default maven profile since
it increases compilation time noticeably. It can be enabled by running
'mvn -Perrorprone'.

Even with this patch there are a bunch of warnings -- this only
addresses the issues that errorprone considers "errors".

Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
---
M fe/pom.xml
M fe/src/main/java/org/apache/impala/analysis/CreateUdfStmt.java
M fe/src/main/java/org/apache/impala/analysis/LiteralExpr.java
M fe/src/main/java/org/apache/impala/analysis/Path.java
M fe/src/main/java/org/apache/impala/catalog/DiskIdMapper.java
M fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
M fe/src/main/java/org/apache/impala/catalog/StructType.java
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
M fe/src/test/java/org/apache/impala/hive/executor/UdfExecutorTest.java
11 files changed, 51 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/10583/2
-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[Impala-ASF-CR] IMPALA-7110. Fix some warnings from error-prone

Posted by "Bharath Vissapragada (Code Review)" <ge...@cloudera.org>.
Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix some warnings from error-prone
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
File fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java:

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java@85
PS1, Line 85: argTypes
nit: Should we update this too?



-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 Jun 2018 20:16:02 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Bharath Vissapragada (Code Review)" <ge...@cloudera.org>.
Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................


Patch Set 2: Code-Review+1

(1 comment)

Phil, can you +2 this, I'm not too familiar with mvn profiles, rest of it lgtm.

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
File fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java:

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java@85
PS1, Line 85: argTypes
> argTypes is a List, so the built-in toString actually works. My fix down be
ah, nice catch.



-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 05 Jun 2018 22:11:57 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7110. Fix some warnings from error-prone

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix some warnings from error-prone
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG@21
PS1, Line 21: I elected not to enable error-prone in the maven settings since it
> It's likely posssibly to use Maven profiles to make this an optional flag. 
I'll give this a try, though usually when I attempt to do this kind of thing I end up just banging my head against my desk in frustration.


http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java
File fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java:

http://gerrit.cloudera.org:8080/#/c/10583/1/fe/src/main/java/org/apache/impala/catalog/ScalarFunction.java@85
PS1, Line 85: argTypes
> nit: Should we update this too?
interesting, wonder why it didn't catch this one. Will do.



-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Tue, 05 Jun 2018 17:55:14 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................


Patch Set 3:

This change did not cherrypick successfully into branch 2.x. To resolve this, please do the cherry-pick manually and submit it to Gerrit at refs/for/2.x or add an exception to the branch 2.x copy of bin/ignored_commits.json. Thanks, your friendly bot at https://jenkins.impala.io/job/cherrypick-2.x-and-test/590/ .


-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 3
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Thu, 07 Jun 2018 00:25:07 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7110. Fix some warnings from error-prone

Posted by "Philip Zeyliger (Code Review)" <ge...@cloudera.org>.
Philip Zeyliger has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix some warnings from error-prone
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/10583/1//COMMIT_MSG@21
PS1, Line 21: I elected not to enable error-prone in the maven settings since it
It's likely posssibly to use Maven profiles to make this an optional flag. Not a blocking issue, but I'd be happy to review a new profile that does this. We could likely run it in parallel during GVOs without much harm, like we do with clang-tidy and such.



-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Comment-Date: Mon, 04 Jun 2018 20:19:04 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7110. Fix errors from error-prone

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/10583 )

Change subject: IMPALA-7110. Fix errors from error-prone
......................................................................


Patch Set 2: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/10583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9bfadecb5b92bba4fc7921a6f87f249ed90e771
Gerrit-Change-Number: 10583
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <ph...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-Comment-Date: Wed, 06 Jun 2018 01:46:57 +0000
Gerrit-HasComments: No