Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ case class DropTableCommand(
sparkSession.sharedState.cacheManager.uncacheQuery(
sparkSession.table(tableName.quotedString))
} catch {
case ae: AnalysisException if ae.getMessage.contains("Table or view not found") =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it NoSuchTableException?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for review, @gatorsmile .
It's originally NoSuchTableException, but Analyzer changed into this at here.
So, the catch expression becomes ugly.

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I fix that to throw the original exception? NoSuchTableException extends AnalysisException and has more context like database name. Oops, Sorry. We cannot. The current AnalysisException has the line number and start position.

case NonFatal(e) => log.warn(e.toString, e)
}
catalog.refreshTable(tableName)
Expand Down