This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new b59b9e1e321 [SPARK-37945][SQL][FOLLOWUP] Rename the error class 
`INCORRECT_RUMP_UP_RATE`
b59b9e1e321 is described below

commit b59b9e1e3211089b2f05c6c040ad7236696c5bdc
Author: Max Gekk <max.g...@gmail.com>
AuthorDate: Wed Oct 26 09:39:21 2022 +0300

    [SPARK-37945][SQL][FOLLOWUP] Rename the error class `INCORRECT_RUMP_UP_RATE`
    
    ### What changes were proposed in this pull request?
    In the PR, I propose to fix a typo by renaming the error class 
INCORRECT_RUMP_UP_RATE to INCORRECT_RAMP_UP_RATE, and rename the method 
`incorrectRumpUpRate()` to `incorrectRampUpRate()`.
    
    ### Why are the changes needed?
    To don't confuse user, and fix the typo.
    
    ### Does this PR introduce _any_ user-facing change?
    No. The error class hasn't released yet.
    
    ### How was this patch tested?
    By running the affected tests:
    ```
    $ build/sbt "test:testOnly *RateStreamProviderSuite"
    $ build/sbt "core/testOnly *SparkThrowableSuite"
    ```
    
    Closes #38391 from MaxGekk/rename-INCORRECT_RUMP_UP_RATE.
    
    Authored-by: Max Gekk <max.g...@gmail.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 core/src/main/resources/error/error-classes.json                      | 2 +-
 .../main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala | 4 ++--
 .../sql/execution/streaming/sources/RateStreamMicroBatchStream.scala  | 2 +-
 .../sql/execution/streaming/sources/RateStreamProviderSuite.scala     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/src/main/resources/error/error-classes.json 
b/core/src/main/resources/error/error-classes.json
index 6f5b3b5a134..805785e2a42 100644
--- a/core/src/main/resources/error/error-classes.json
+++ b/core/src/main/resources/error/error-classes.json
@@ -453,7 +453,7 @@
       "Max offset with <rowsPerSecond> rowsPerSecond is <maxSeconds>, but it's 
<endSeconds> now."
     ]
   },
-  "INCORRECT_RUMP_UP_RATE" : {
+  "INCORRECT_RAMP_UP_RATE" : {
     "message" : [
       "Max offset with <rowsPerSecond> rowsPerSecond is <maxSeconds>, but 
'rampUpTimeSeconds' is <rampUpTimeSeconds>."
     ]
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
index 4aedfb3b03d..4a2c0ac71ed 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
@@ -2387,11 +2387,11 @@ private[sql] object QueryExecutionErrors extends 
QueryErrorsBase {
     new SparkException("Foreach writer has been aborted due to a task failure")
   }
 
-  def incorrectRumpUpRate(rowsPerSecond: Long,
+  def incorrectRampUpRate(rowsPerSecond: Long,
       maxSeconds: Long,
       rampUpTimeSeconds: Long): Throwable = {
     new SparkRuntimeException(
-      errorClass = "INCORRECT_RUMP_UP_RATE",
+      errorClass = "INCORRECT_RAMP_UP_RATE",
       messageParameters = Map(
         "rowsPerSecond" -> rowsPerSecond.toString,
         "maxSeconds" -> maxSeconds.toString,
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamMicroBatchStream.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamMicroBatchStream.scala
index 45c37d8ae77..5640c7d3ca7 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamMicroBatchStream.scala
+++ 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamMicroBatchStream.scala
@@ -52,7 +52,7 @@ class RateStreamMicroBatchStream(
   private val maxSeconds = Long.MaxValue / rowsPerSecond
 
   if (rampUpTimeSeconds > maxSeconds) {
-    throw QueryExecutionErrors.incorrectRumpUpRate(
+    throw QueryExecutionErrors.incorrectRampUpRate(
       rowsPerSecond, maxSeconds, rampUpTimeSeconds)
   }
 
diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamProviderSuite.scala
 
b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamProviderSuite.scala
index 175f26dc0bb..4f37d2d3536 100644
--- 
a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamProviderSuite.scala
+++ 
b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/RateStreamProviderSuite.scala
@@ -197,7 +197,7 @@ class RateStreamProviderSuite extends StreamTest {
     }
   }
 
-  testQuietly("microbatch - rump up error") {
+  testQuietly("microbatch - ramp up error") {
     val e = intercept[SparkRuntimeException](
       new RateStreamMicroBatchStream(
         rowsPerSecond = Long.MaxValue,
@@ -207,7 +207,7 @@ class RateStreamProviderSuite extends StreamTest {
 
     checkError(
       exception = e,
-      errorClass = "INCORRECT_RUMP_UP_RATE",
+      errorClass = "INCORRECT_RAMP_UP_RATE",
       parameters = Map(
         "rowsPerSecond" -> Long.MaxValue.toString,
         "maxSeconds" -> "1",


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

Reply via email to