pan3793 commented on code in PR #43620:
URL: https://github.com/apache/spark/pull/43620#discussion_r1381192396


##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala:
##########
@@ -2766,7 +2767,8 @@ class DataFrameSuite extends QueryTest
         // The data set has 2 partitions, so Spark will write at least 2 json 
files.
         // Use a non-splittable compression (gzip), to make sure the json scan 
RDD has at least 2
         // partitions.
-        .write.partitionBy("p").option("compression", 
"gzip").json(path.getCanonicalPath)
+        .write.partitionBy("p")
+        .option("compression", 
GZIP.lowerCaseName()).json(path.getCanonicalPath)

Review Comment:
   It's a best practice, no compile warnings, because the compiler has no idea 
will this method have side effects.
   
   Suggestion about [uniform access 
principle](https://en.wikipedia.org/wiki/Uniform_access_principle) from 
[Databricks Scala 
Guide](https://github.com/databricks/scala-style-guide#parentheses) and 
IntelliJ IDEA
   
   > Reports calls to Java accessor methods with empty argument clauses.
   >
   > Methods that follow the JavaBean naming contract for accessors are 
expected to have no side effects. The recommended convention is to use a 
parameterless method whenever there are no parameters and the method have no 
side effect. This convention promotes the [uniform access 
principle](https://en.wikipedia.org/wiki/Uniform_access_principle), which says 
that the client code should not be affected by the decision to implement an 
attribute as a field or method.
   > The problem is that Java does not implement the uniform access principle. 
To bridge that gap, Scala allows you to leave off the empty parentheses on an 
invocation of a Java method that takes no arguments.
   > 
   > The quick-fix removes the empty argument clause.
   > Example:
   > ```
   > "test".getClass()
   > ```
   > After the quick-fix is applied:
   > ```
   > "test".getClass
   > ```
   
    



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

To unsubscribe, e-mail: [email protected]

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