spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14414] [SQL] improve the error message ...
Date Tue, 12 Apr 2016 21:42:43 GMT
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12314#discussion_r59459425
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/NoSuchItemException.scala
---
    @@ -17,36 +17,21 @@
     
     package org.apache.spark.sql.catalyst.analysis
     
    +import org.apache.spark.sql.AnalysisException
     import org.apache.spark.sql.catalyst.catalog.ExternalCatalog.TablePartitionSpec
     
     
     /**
      * Thrown by a catalog when an item cannot be found. The analyzer will rethrow the exception
      * as an [[org.apache.spark.sql.AnalysisException]] with the correct position information.
      */
    -abstract class NoSuchItemException extends Exception {
    -  override def getMessage: String
    -}
    +class NoSuchDatabaseException(db: String) extends AnalysisException(s"Database $db not
found")
     
    -class NoSuchDatabaseException(db: String) extends NoSuchItemException {
    -  override def getMessage: String = s"Database $db not found"
    -}
    +class NoSuchTableException(db: String, table: String)
    +  extends AnalysisException(s"Table or View $table not found in database $db")
     
    -class NoSuchTableException(db: String, table: String) extends NoSuchItemException {
    -  override def getMessage: String = s"Table or View $table not found in database $db"
    -}
    +class NoSuchPartitionException(db: String, table: String, spec: TablePartitionSpec) extends
    +    AnalysisException(s"Partition not found in table $table database $db:\n" + spec.mkString("\n"))
    --- End diff --
    
    style:
    ```
    class NoSuch...Exception(
        db: String,
        table: String,
        spec: ...)
      extends AnalysisException("...")
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message