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 2022/05/14 10:01:09 UTC

[GitHub] [spark] MaxGekk opened a new pull request, #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`

MaxGekk opened a new pull request, #36550:
URL: https://github.com/apache/spark/pull/36550

   ### What changes were proposed in this pull request?
   Remove `SparkIllegalStateException` and replace it by `IllegalStateException` where it was used.
   
   ### Why are the changes needed?
   To improve code maintenance and be consistent to other places where `IllegalStateException` is used in illegal states (for instance, see https://github.com/apache/spark/pull/36524). After the PR https://github.com/apache/spark/pull/36500, the exception is substituted by `SparkException` w/ the `INTERNAL_ERROR` error class.
   
   ### Does this PR introduce _any_ user-facing change?
   No. Users shouldn't face to the exception in regular cases.
   
   ### How was this patch tested?
   By running the affected test suites:
   ```
   $ build/sbt "sql/test:testOnly *QueryExecutionErrorsSuite*"
   $ build/sbt "test:testOnly *ArrowUtilsSuite"
   ```


-- 
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-unsubscribe@spark.apache.org

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


[GitHub] [spark] MaxGekk commented on a diff in pull request #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #36550:
URL: https://github.com/apache/spark/pull/36550#discussion_r872960720


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -272,15 +271,6 @@ class QueryExecutionErrorsSuite
     }
   }
 
-  test("INTERNAL_ERROR: timeZoneId not specified while converting TimestampType to Arrow") {
-    checkErrorClass(
-      exception = intercept[SparkIllegalStateException] {
-        ArrowUtils.toArrowSchema(new StructType().add("value", TimestampType), null)

Review Comment:
   The internal API is tested by `ArrowUtilsSuite` already.



-- 
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-unsubscribe@spark.apache.org

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


[GitHub] [spark] MaxGekk commented on pull request #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #36550:
URL: https://github.com/apache/spark/pull/36550#issuecomment-1127234215

   Merging to master. Thank you, @HyukjinKwon and @cloud-fan for review.


-- 
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-unsubscribe@spark.apache.org

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


[GitHub] [spark] AngersZhuuuu commented on a diff in pull request #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on code in PR #36550:
URL: https://github.com/apache/spark/pull/36550#discussion_r873294811


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -582,8 +582,8 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog {
                  |in operator ${operator.simpleString(SQLConf.get.maxToStringFields)}
                """.stripMargin)
 
-          case _: UnresolvedHint =>
-            throw QueryExecutionErrors.logicalHintOperatorNotRemovedDuringAnalysisError
+          case _: UnresolvedHint => throw new IllegalStateException(
+            "Logical hint operator should be removed during analysis.")

Review Comment:
   How about
   ```
    case _: UnresolvedHint =>
           throw new IllegalStateException("Logical hint operator should be removed during analysis.")
   ```
   



-- 
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-unsubscribe@spark.apache.org

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


[GitHub] [spark] MaxGekk closed pull request #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #36550: [SPARK-39187][SQL] Remove `SparkIllegalStateException`
URL: https://github.com/apache/spark/pull/36550


-- 
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-unsubscribe@spark.apache.org

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