Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/14235#discussion_r71111037
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/catalyst/LogicalPlanToSQLSuite.scala
---
@@ -17,15 +17,32 @@
package org.apache.spark.sql.catalyst
+import java.nio.charset.StandardCharsets
+import java.nio.file.{Files, NoSuchFileException, Paths}
+
import scala.util.control.NonFatal
import org.apache.spark.sql.Column
+import org.apache.spark.sql.catalyst.parser.ParseException
import org.apache.spark.sql.functions._
import org.apache.spark.sql.test.SQLTestUtils
+/**
+ * A test suite for LogicalPlan-to-SQL conversion.
+ *
+ * Each query has a golden generated SQL file in test/resources/sqlgen.
The test suite also has
+ * built-in functionality to automatically generate these golden files.
+ *
+ * To re-generate golden files, run:
+ * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "hive/test-only
*LogicalPlanToSQLSuite"
+ */
class LogicalPlanToSQLSuite extends SQLBuilderTest with SQLTestUtils {
import testImplicits._
+ // Used for generating new query answer files by saving
+ private val saveQuery = System.getenv("SPARK_GENERATE_GOLDEN_FILES") !=
null
--- End diff --
hm if it is 0 we probably shouldn't be running it, so i'd test the value
against 1
```
Option(System.getenv("SPARK_GENERATE_GOLDEN_FILES")) == Some("1")
---
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]