Skip to content

Commit a668bb5

Browse files
committed
Don't remove file when testing
1 parent 703d23e commit a668bb5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,14 @@ private[sql] class HiveSessionCatalog(
150150
case ArchiveResource =>
151151
ResourceType.ARCHIVE
152152
}
153-
val sessionState = SessionState.get()
154-
val localPath = sessionState.add_resource(resourceType, resource.uri)
155-
ShutdownHookManager.registerShutdownDeleteDir(new File(localPath).getParentFile)
156-
functionResourceLoader.loadResource(FunctionResource(resource.resourceType, localPath))
153+
if (System.getProperties("spark.testing") != "true") {
154+
val sessionState = SessionState.get()
155+
val localPath = sessionState.add_resource(resourceType, resource.uri)
156+
ShutdownHookManager.registerShutdownDeleteDir(new File(localPath).getParentFile)
157+
functionResourceLoader.loadResource(FunctionResource(resource.resourceType, localPath))
158+
} else {
159+
functionResourceLoader.loadResource(resource)
160+
}
157161
}
158162
}
159163

0 commit comments

Comments
 (0)