You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/10 01:26:28 UTC

[GitHub] [spark] srowen commented on a change in pull request #29995: [SPARK-33080][BUILD] Replace fatal warnings snippet

srowen commented on a change in pull request #29995:
URL: https://github.com/apache/spark/pull/29995#discussion_r502727803



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/connector/InMemoryTable.scala
##########
@@ -106,6 +106,18 @@ class InMemoryTable(
           case (micros: Long, TimestampType) =>
             val localDate = DateTimeUtils.microsToInstant(micros).atZone(UTC).toLocalDate
             ChronoUnit.YEARS.between(EPOCH_LOCAL_DATE, localDate)
+          case _ => throw new Exception("""match may not be exhaustive.

Review comment:
       I'd make this more meaningful, like an IllegalArgumentException referring to the thing that does not match. Something simple.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala
##########
@@ -705,7 +705,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
     val q2 = startQuery(input(1).toDS.map { i =>
       // Emulate that `StreamingQuery` get captured with normal usage unintentionally.
       // It should not fail the query.
-      q1
+      val q = q1

Review comment:
       This warning has always bugged me. I'm not sure if this change subverts the test itself, but, not sure this is any better or worse at accidentally capturing q1, so I'm OK with it.




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

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



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