spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatorsmile <...@git.apache.org>
Subject [GitHub] spark pull request #14962: [SPARK-17402][SQL] separate the management of tem...
Date Wed, 07 Sep 2016 16:36:22 GMT
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14962#discussion_r77858872
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala
---
    @@ -95,12 +95,12 @@ class SQLViewSuite extends QueryTest with SQLTestUtils with TestHiveSingleton
{
           e = intercept[AnalysisException] {
             sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE $viewName""")
           }.getMessage
    -      assert(e.contains(s"Target table in LOAD DATA cannot be temporary: `$viewName`"))
    +      assert(e.contains(s"Target table in LOAD DATA does not exist: `$viewName`"))
    --- End diff --
    
    ```Scala
        if (!catalog.tableExists(table)) {
          throw new AnalysisException(s"Target table in LOAD DATA does not exist: $table")
        }
        val targetTable = catalog.getTableMetadataOption(table).getOrElse {
          throw new AnalysisException(s"Target table in LOAD DATA cannot be temporary: $table")
        }
    ```
    
    Currently, the message in the `getOrElse` becomes unreachable. Maybe, we can simplify
it by
    
    ```Scala
        if (!catalog.tableExists(table)) {
          throw new AnalysisException(s"Target table in LOAD DATA does not exist: $table")
        }
        val targetTable = catalog.getTableMetadata(table)
    ```
    Or
    ```
        val targetTable = catalog.getTableMetadata(table)
    ```


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