AngersZhuuuu commented on a change in pull request #29588:
URL: https://github.com/apache/spark/pull/29588#discussion_r479933926



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala
##########
@@ -36,6 +38,15 @@ class HiveScriptTransformationSuite extends 
BaseScriptTransformationSuite with T
 
   import ScriptTransformationIOSchema._
 
+  protected override def getTestResourcePath(fileName: String): String = {
+    val url = 
Thread.currentThread().getContextClassLoader.getResource(fileName)
+    // Copy to avoid URISyntaxException during accessing the resources in 
`sql/core`
+    val file = File.createTempFile("script-transformation-test", ".py")
+    file.deleteOnExit()
+    FileUtils.copyURLToFile(url, file)
+    file.getAbsolutePath

Review comment:
       > Can we share the code?
   > 
   > 
https://github.com/apache/spark/blob/a1e459ed9f6777fb8d5a2d09fda666402f9230b9/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala#L60-L67
   
   Seems can, we this method fro SQLTestUtils, and 
BasicScripTransformationExecSuite extend SQLTestUtils




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to