You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2019/06/21 16:51:26 UTC

[incubator-iceberg] branch master updated: Update Guava to fix IntelliJ (#229)

This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b621b7  Update Guava to fix IntelliJ (#229)
4b621b7 is described below

commit 4b621b77161524ebe65d3e1b7529810e00a38878
Author: Suren Nihalani <sn...@gmail.com>
AuthorDate: Fri Jun 21 09:51:22 2019 -0700

    Update Guava to fix IntelliJ (#229)
    
    Test Plan: ./gradlew build (it runs unit tests)
---
 build.gradle                                             | 16 ++++++++++------
 .../main/java/org/apache/iceberg/common/DynFields.java   |  4 ++--
 .../main/java/org/apache/iceberg/BaseFileScanTask.java   |  4 ++--
 core/src/main/java/org/apache/iceberg/BaseSnapshot.java  |  4 ++--
 core/src/main/java/org/apache/iceberg/BaseTableScan.java |  4 ++--
 .../main/java/org/apache/iceberg/GenericDataFile.java    |  4 ++--
 .../java/org/apache/iceberg/GenericManifestFile.java     |  3 ++-
 .../org/apache/iceberg/GenericPartitionFieldSummary.java |  4 ++--
 core/src/main/java/org/apache/iceberg/ManifestEntry.java |  4 ++--
 core/src/main/java/org/apache/iceberg/TableMetadata.java |  3 ++-
 10 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/build.gradle b/build.gradle
index fd0e1e3..3ebdae7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -95,7 +95,7 @@ subprojects {
 
   dependencies {
     compileOnly 'org.slf4j:slf4j-api:1.7.5'
-    compileOnly 'com.google.guava:guava:16.0.1'
+    compileOnly 'com.google.guava:guava:28.0-jre'
 
     testCompile 'junit:junit:4.12'
     testCompile 'org.slf4j:slf4j-simple:1.7.5'
@@ -115,7 +115,7 @@ subprojects {
 
 // We enable baseline-idea everywhere so that everyone can use IntelliJ to build code against the
 // Baseline style guide.
-def baselineProjects = [ project("iceberg-api"), project("iceberg-common"), project("iceberg-core"), 
+def baselineProjects = [ project("iceberg-api"), project("iceberg-common"), project("iceberg-core"),
                          project("iceberg-data"), project("iceberg-orc") ]
 
 
@@ -134,7 +134,7 @@ configure(baselineProjects) {
   // to be applied to ALL projects. And we are not prepared to address all of the build errors that
   // occur as a result at this time. Furthermore, baseline-format will not work out of the box for
   // us - see below.
-  
+
   // Thus we concede to applying all of the Baseline plugins individually on all the projects we are
   // ready to enforce linting on.
   apply plugin: 'org.inferred.processors'
@@ -145,10 +145,10 @@ configure(baselineProjects) {
   apply plugin: 'com.palantir.baseline-reproducibility'
   apply plugin: 'com.palantir.baseline-exact-dependencies'
   apply plugin: 'com.palantir.baseline-release-compatibility'
-  
+
   // Can't use the built-in Baseline spotless format because it's opinionated about the import
   // order of having static imports after non-static imports, and this cannot be overridden.
-  
+
   // So we apply Spotless manually to get a similar effect to baseline-format, but change the
   // import order.
   pluginManager.withPlugin('com.diffplug.gradle.spotless') {
@@ -235,7 +235,11 @@ project(':iceberg-hive') {
       exclude group: 'org.slf4j', module: 'slf4j-log4j12'
     }
 
-    testCompile("org.apache.hive:hive-exec:$hiveVersion") {
+    // By default, hive-exec is a fat/uber jar and it exports a guava library
+    // that's really old. We use the core classifier to be able to override our guava
+    // version. Luckily, hive-exec seems to work okay so far with this version of guava
+    // See: https://github.com/apache/hive/blob/master/ql/pom.xml#L911 for more context.
+    testCompile("org.apache.hive:hive-exec:$hiveVersion:core") {
       exclude group: 'org.apache.avro', module: 'avro'
       exclude group: 'org.slf4j', module: 'slf4j-log4j12'
       exclude group: 'org.pentaho' // missing dependency
diff --git a/common/src/main/java/org/apache/iceberg/common/DynFields.java b/common/src/main/java/org/apache/iceberg/common/DynFields.java
index f989f20..196399a 100644
--- a/common/src/main/java/org/apache/iceberg/common/DynFields.java
+++ b/common/src/main/java/org/apache/iceberg/common/DynFields.java
@@ -20,7 +20,7 @@
 package org.apache.iceberg.common;
 
 import com.google.common.base.Joiner;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Sets;
@@ -69,7 +69,7 @@ public class DynFields {
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("class", field.getDeclaringClass().toString())
           .add("name", name)
           .add("type", field.getType())
diff --git a/core/src/main/java/org/apache/iceberg/BaseFileScanTask.java b/core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
index 77ae7a6..988b07e 100644
--- a/core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
+++ b/core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
@@ -20,7 +20,7 @@
 package org.apache.iceberg;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -86,7 +86,7 @@ class BaseFileScanTask implements FileScanTask {
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("file", file.path())
         .add("partition_data", file.partition())
         .add("residual", residual())
diff --git a/core/src/main/java/org/apache/iceberg/BaseSnapshot.java b/core/src/main/java/org/apache/iceberg/BaseSnapshot.java
index b5199b8..c2e59af 100644
--- a/core/src/main/java/org/apache/iceberg/BaseSnapshot.java
+++ b/core/src/main/java/org/apache/iceberg/BaseSnapshot.java
@@ -19,7 +19,7 @@
 
 package org.apache.iceberg;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import java.io.IOException;
@@ -182,7 +182,7 @@ class BaseSnapshot implements Snapshot {
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("id", snapshotId)
         .add("timestamp_ms", timestampMillis)
         .add("operation", operation)
diff --git a/core/src/main/java/org/apache/iceberg/BaseTableScan.java b/core/src/main/java/org/apache/iceberg/BaseTableScan.java
index 302aa16..50364ee 100644
--- a/core/src/main/java/org/apache/iceberg/BaseTableScan.java
+++ b/core/src/main/java/org/apache/iceberg/BaseTableScan.java
@@ -21,7 +21,7 @@ package org.apache.iceberg;
 
 import com.github.benmanes.caffeine.cache.Caffeine;
 import com.github.benmanes.caffeine.cache.LoadingCache;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
@@ -241,7 +241,7 @@ class BaseTableScan implements TableScan {
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("table", table)
         .add("projection", schema().asStruct())
         .add("filter", rowFilter)
diff --git a/core/src/main/java/org/apache/iceberg/GenericDataFile.java b/core/src/main/java/org/apache/iceberg/GenericDataFile.java
index 04a1160..bca4ce8 100644
--- a/core/src/main/java/org/apache/iceberg/GenericDataFile.java
+++ b/core/src/main/java/org/apache/iceberg/GenericDataFile.java
@@ -19,7 +19,7 @@
 
 package org.apache.iceberg;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
@@ -406,7 +406,7 @@ class GenericDataFile
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("file_path", filePath)
         .add("file_format", format)
         .add("partition", partitionData)
diff --git a/core/src/main/java/org/apache/iceberg/GenericManifestFile.java b/core/src/main/java/org/apache/iceberg/GenericManifestFile.java
index c19c6f0..d634488 100644
--- a/core/src/main/java/org/apache/iceberg/GenericManifestFile.java
+++ b/core/src/main/java/org/apache/iceberg/GenericManifestFile.java
@@ -19,6 +19,7 @@
 
 package org.apache.iceberg;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
@@ -296,7 +297,7 @@ public class GenericManifestFile
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("path", manifestPath)
         .add("length", length)
         .add("partition_spec_id", specId)
diff --git a/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java b/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java
index 2a12fa0..cf9418e 100644
--- a/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java
+++ b/core/src/main/java/org/apache/iceberg/GenericPartitionFieldSummary.java
@@ -19,7 +19,7 @@
 
 package org.apache.iceberg;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import java.io.Serializable;
 import java.nio.ByteBuffer;
 import java.util.List;
@@ -182,7 +182,7 @@ public class GenericPartitionFieldSummary
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("contains_null", containsNull)
         .add("lower_bound", lowerBound)
         .add("upper_bound", upperBound)
diff --git a/core/src/main/java/org/apache/iceberg/ManifestEntry.java b/core/src/main/java/org/apache/iceberg/ManifestEntry.java
index bbea3a9..584f007 100644
--- a/core/src/main/java/org/apache/iceberg/ManifestEntry.java
+++ b/core/src/main/java/org/apache/iceberg/ManifestEntry.java
@@ -19,7 +19,7 @@
 
 package org.apache.iceberg;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import java.util.Collection;
 import org.apache.avro.generic.IndexedRecord;
 import org.apache.avro.specific.SpecificData;
@@ -176,7 +176,7 @@ class ManifestEntry implements IndexedRecord, SpecificData.SchemaConstructable {
 
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("status", status)
         .add("snapshot_id", snapshotId)
         .add("file", file)
diff --git a/core/src/main/java/org/apache/iceberg/TableMetadata.java b/core/src/main/java/org/apache/iceberg/TableMetadata.java
index 4207ad2..a7c0288 100644
--- a/core/src/main/java/org/apache/iceberg/TableMetadata.java
+++ b/core/src/main/java/org/apache/iceberg/TableMetadata.java
@@ -19,6 +19,7 @@
 
 package org.apache.iceberg;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
@@ -115,7 +116,7 @@ public class TableMetadata {
 
     @Override
     public String toString() {
-      return Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("timestampMillis", timestampMillis)
           .add("snapshotId", snapshotId)
           .toString();