Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14235#discussion_r71257369
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/catalyst/LogicalPlanToSQLSuite.scala
 ---
    @@ -17,15 +17,33 @@
     
     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 regenerateGoldenFiles =
    +    Option(System.getenv("SPARK_GENERATE_GOLDEN_FILES")).contains("1")
    --- End diff --
    
    Why did you use contains here? This is super confusing and also broke 2.10.
    
    I think I asked to do comparison with Some("1"). In most cases it is a very 
bad idea to use collection-oriented methods on Options, because they make the 
code more confusing.



---
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]

Reply via email to