kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject kudu git commit: [kudu-spark] Clean up some build warnings from Scala 2.11
Date Thu, 03 Nov 2016 16:32:45 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 4b61a3a4f -> 63059a903


[kudu-spark] Clean up some build warnings from Scala 2.11

The new Spark 2.x with Scala 2.11 build has more warnings than the
old Spark 1.x with Scala 2.10 one. This patch fixes them. No new
or altered functionality.

Change-Id: I0f8d9095fc7e361da1c02098411ce4088d6d743a
Reviewed-on: http://gerrit.cloudera.org:8080/4924
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans <jdcryans@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/63059a90
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/63059a90
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/63059a90

Branch: refs/heads/master
Commit: 63059a9034fd9c08b973107a47d882b4640daaf8
Parents: 4b61a3a
Author: Will Berkeley <wdberkeley@gmail.com>
Authored: Wed Nov 2 15:12:51 2016 -0400
Committer: Jean-Daniel Cryans <jdcryans@apache.org>
Committed: Thu Nov 3 16:32:32 2016 +0000

----------------------------------------------------------------------
 java/kudu-spark/pom.xml                                |  1 +
 .../scala/org/apache/kudu/spark/kudu/KuduRDD.scala     | 12 ++++++------
 .../org/apache/kudu/spark/kudu/DefaultSourceTest.scala | 13 +++++++------
 3 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/63059a90/java/kudu-spark/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-spark/pom.xml b/java/kudu-spark/pom.xml
index f9a0fcc..13b58d8 100644
--- a/java/kudu-spark/pom.xml
+++ b/java/kudu-spark/pom.xml
@@ -167,6 +167,7 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.12</version>
                 <executions>
                     <execution>
                         <phase>generate-sources</phase>

http://git-wip-us.apache.org/repos/asf/kudu/blob/63059a90/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/KuduRDD.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/KuduRDD.scala b/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/KuduRDD.scala
index 33b23a4..f9686be 100644
--- a/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/KuduRDD.scala
+++ b/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/KuduRDD.scala
@@ -28,12 +28,12 @@ import scala.collection.JavaConverters._
   * A Resilient Distributed Dataset backed by a Kudu table.
   */
 class KuduRDD(val kuduMaster: String,
-              @transient batchSize: Integer,
-              @transient projectedCols: Array[String],
-              @transient predicates: Array[client.KuduPredicate],
-              @transient table: KuduTable,
-              @transient kc: KuduContext,
-              @transient sc: SparkContext) extends RDD[Row](sc, Nil) {
+              @transient val batchSize: Integer,
+              @transient val projectedCols: Array[String],
+              @transient val predicates: Array[client.KuduPredicate],
+              @transient val table: KuduTable,
+              @transient val kc: KuduContext,
+              @transient val sc: SparkContext) extends RDD[Row](sc, Nil) {
 
   /**
     * The [[KuduContext]] for this `KuduRDD`.

http://git-wip-us.apache.org/repos/asf/kudu/blob/63059a90/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
index ed8d627..007bb8d 100644
--- a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
+++ b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
@@ -30,6 +30,7 @@ import org.scalatest.{BeforeAndAfter, FunSuite}
 
 import scala.collection.JavaConverters._
 import scala.collection.immutable.IndexedSeq
+import scala.util.control.NonFatal;
 
 @RunWith(classOf[JUnitRunner])
 class DefaultSourceTest extends FunSuite with TestContext with BeforeAndAfter {
@@ -206,27 +207,27 @@ class DefaultSourceTest extends FunSuite with TestContext with BeforeAndAfter
{
   }
 
   test("table scan with projection and predicate double") {
-    assertEquals(rows.count { case (key, i, s, ts) => i != null && i > 5 },
+    assertEquals(rows.count { case (key, i, s, ts) => i > 5 },
                  sqlContext.sql(s"""SELECT key, c3_double FROM $tableName where c3_double
> "5.0"""").count())
   }
 
   test("table scan with projection and predicate long") {
-    assertEquals(rows.count { case (key, i, s, ts) => i != null && i > 5 },
+    assertEquals(rows.count { case (key, i, s, ts) => i > 5 },
                  sqlContext.sql(s"""SELECT key, c4_long FROM $tableName where c4_long >
"5"""").count())
 
   }
   test("table scan with projection and predicate bool") {
-    assertEquals(rows.count { case (key, i, s, ts) => i != null && i%2==0 },
+    assertEquals(rows.count { case (key, i, s, ts) => i % 2==0 },
                  sqlContext.sql(s"""SELECT key, c5_bool FROM $tableName where c5_bool = true""").count())
 
   }
   test("table scan with projection and predicate short") {
-    assertEquals(rows.count { case (key, i, s, ts) => i != null && i > 5},
+    assertEquals(rows.count { case (key, i, s, ts) => i > 5},
                  sqlContext.sql(s"""SELECT key, c6_short FROM $tableName where c6_short >
5""").count())
 
   }
   test("table scan with projection and predicate float") {
-    assertEquals(rows.count { case (key, i, s, ts) => i != null && i > 5},
+    assertEquals(rows.count { case (key, i, s, ts) => i > 5},
                  sqlContext.sql(s"""SELECT key, c7_float FROM $tableName where c7_float >
5""").count())
 
   }
@@ -336,7 +337,7 @@ class DefaultSourceTest extends FunSuite with TestContext with BeforeAndAfter
{
       fail()
     } catch {
       case _: UnsupportedOperationException => // good
-      case _ => fail()
+      case NonFatal(_) => fail()
     }
   }
 


Mime
View raw message