Skip to content

Commit

Permalink
[SQL] Throw UnsupportedOperationException instead of NotImplementedError
Browse files Browse the repository at this point in the history
NotImplementedError in scala 2.10 is a fatal exception, which is not very nice to throw when not actually fatal.

Author: Michael Armbrust <[email protected]>

Closes apache#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
  • Loading branch information
marmbrus committed Apr 2, 2015
1 parent e3202aa commit 4214e50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 4214e50

Please sign in to comment.