Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/15789#discussion_r86691156
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/catalyst/LogicalPlanToSQLSuite.scala
---
@@ -46,7 +46,15 @@ class LogicalPlanToSQLSuite extends SQLBuilderTest with
SQLTestUtils {
// Used for generating new query answer files by saving
private val regenerateGoldenFiles: Boolean =
System.getenv("SPARK_GENERATE_GOLDEN_FILES") == "1"
- private val goldenSQLPath = getTestResourcePath("sqlgen")
+ private val goldenSQLPath = {
+ // If regenerateGoldenFiles is true, we must be running this in SBT
and we use hard-coded
+ // relative path. Otherwise, we use classloader's getResource to find
the location.
+ if (regenerateGoldenFiles) {
+ java.nio.file.Paths.get("src", "test", "resources",
"sqlgen").toFile.getCanonicalPath
--- End diff --
Sure. I tested this in locally, too.
- Change the query to check the regeneration in the correct directory.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]