LuciferYang commented on code in PR #48128:
URL: https://github.com/apache/spark/pull/48128#discussion_r1762503937


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala:
##########
@@ -22,7 +22,7 @@ import java.time.temporal.ChronoField
 import java.util.{Calendar, TimeZone}
 import java.util.Calendar.{DAY_OF_MONTH, DST_OFFSET, ERA, HOUR_OF_DAY, MINUTE, 
MONTH, SECOND, YEAR, ZONE_OFFSET}
 
-import scala.collection.mutable.AnyRefMap
+import scala.collection.mutable

Review Comment:
   Aside from the original goals of the PR itself, personally, I tend to write 
it as follows:
   
   ```
   import scala.collection.mutable
   val hashMap = new mutable.HashMap[String, RebaseInfo]
   ```
   
   rather than
   
   ```
   import scala.collection.mutable.HashMap
   val hashMap = new HashMap[String, RebaseInfo]
   ```
   
   
   This way, when we need to import `immutable.HashMap` in this class, it won't 
cause a naming conflict (generally, for immutable data structures, there's no 
need to add an extra prefix). Additionally, using `mutable.HashMap` makes the 
code clearer when reading it.
   
   
   Of course, if due to other historical reasons we must write it in the second 
way, then that is also feasible.
   



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to