Repository: spark
Updated Branches:
  refs/heads/master e3202aa2e -> 4214e50fc


[SQL] Throw UnsupportedOperationException instead of NotImplementedError

NotImplementedError in scala 2.10 is a fatal exception, which is not very nice 
to throw when not actually fatal.

Author: Michael Armbrust <mich...@databricks.com>

Closes #5315 from marmbrus/throwUnsupported and squashes the following commits:

c29e03b [Michael Armbrust] [SQL] Throw UnsupportedOperationException instead of 
NotImplementedError
052e05b [Michael Armbrust] [SQL] Throw UnsupportedOperationException instead of 
NotImplementedError


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/4214e50f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/4214e50f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/4214e50f

Branch: refs/heads/master
Commit: 4214e50fc32de1478584d8edfa3a35576c12c025
Parents: e3202aa
Author: Michael Armbrust <mich...@databricks.com>
Authored: Thu Apr 2 16:01:03 2015 -0700
Committer: Michael Armbrust <mich...@databricks.com>
Committed: Thu Apr 2 16:01:03 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/hive/HiveContext.scala  | 5 ++---
 .../test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4214e50f/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala 
b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
index 6bb1c47..46991fb 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
@@ -184,9 +184,8 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
           catalog.client.alterTable(tableFullName, new Table(hiveTTable))
         }
       case otherRelation =>
-        throw new NotImplementedError(
-          s"Analyze has only implemented for Hive tables, " +
-            s"but $tableName is a ${otherRelation.nodeName}")
+        throw new UnsupportedOperationException(
+          s"Analyze only works for Hive tables, but $tableName is a 
${otherRelation.nodeName}")
     }
   }
 

http://git-wip-us.apache.org/repos/asf/spark/blob/4214e50f/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
index 1e05a02..ccd0e5a 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
@@ -120,7 +120,7 @@ class StatisticsSuite extends QueryTest with 
BeforeAndAfterAll {
 
     // Try to analyze a temp table
     sql("""SELECT * FROM src""").registerTempTable("tempTable")
-    intercept[NotImplementedError] {
+    intercept[UnsupportedOperationException] {
       analyze("tempTable")
     }
     catalog.unregisterTable(Seq("tempTable"))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to