Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
beliefer committed May 11, 2021
1 parent bab4787 commit 4284458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ private[spark] object QueryCompilationErrors {
new AnalysisException("function is only supported in v1 catalog")
}

def operateHiveDataSourceDirectlyError(operation: String): Throwable = {
def cannotOperateOnHiveDataSourceFilesError(operation: String): Throwable = {
new AnalysisException("Hive data source can only be used with tables, you can not " +
s"$operation files of Hive data source directly.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ final class DataStreamReader private[sql](sparkSession: SparkSession) extends Lo

private def loadInternal(path: Option[String]): DataFrame = {
if (source.toLowerCase(Locale.ROOT) == DDLUtils.HIVE_PROVIDER) {
throw QueryCompilationErrors.operateHiveDataSourceDirectlyError("read")
throw QueryCompilationErrors.cannotOperateOnHiveDataSourceFilesError("read")
}

val optionsWithPath = if (path.isEmpty) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ final class DataStreamWriter[T] private[sql](ds: Dataset[T]) {

private def startInternal(path: Option[String]): StreamingQuery = {
if (source.toLowerCase(Locale.ROOT) == DDLUtils.HIVE_PROVIDER) {
throw QueryCompilationErrors.operateHiveDataSourceDirectlyError("write")
throw QueryCompilationErrors.cannotOperateOnHiveDataSourceFilesError("write")
}

if (source == SOURCE_NAME_MEMORY) {
Expand Down

0 comments on commit 4284458

Please sign in to comment.