[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-07-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/20177


---

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



[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-05-18 Thread suchithjn225
GitHub user suchithjn225 reopened a pull request:

https://github.com/apache/spark/pull/20177

[SPARK-22954][SQL] Fix the exception thrown by Analyze command on temporary 
views to throw AnalysisException

## What changes were proposed in this pull request?
Previously running ANALYZE on temporary views produced NoSuchTableException 
even though the view was present. It is misleading. So it has to be changed to 
throw AnalysisException since it comes in the analysis part. 

## How was this patch tested?
Some unit tests were fixed to intercept AnalysisException instead of 
NoSuchTableException.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/suchithjn225/spark SPARK-22954-SQL

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/20177.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #20177


commit 8e92e6c26f61ac1999d76993756b8c696e487165
Author: Suchith J N 
Date:   2018-01-05T21:46:20Z

[SPARK-22954][SQL] Fixed the problem where temporary views were not looked 
up by session state's catalog.

commit 4de6ac840a6b8cbd7c5795b023783b626b21a9f4
Author: Suchith J N 
Date:   2018-01-06T19:01:37Z

[SPARK-22954][SQL] Fixed database name lookup so that None is returned 
instead of Some('default')

commit 98b8711cdd26c25fd774f77f46fc9e395ee2cffe
Author: Suchith J N 
Date:   2018-01-07T10:09:33Z

[SPARK-22954][SQL] Fixed the test to test for AnalysisException instead of 
NoSuchTableException

commit 0e873e5fcfe0858d869d9cb9cf63597c6746b734
Author: Suchith J N 
Date:   2018-01-21T05:14:53Z

[SPARK-22954][SQL] Fix the problem for other versions of analyze commands - 
AnalyzeColum and AnalyzePartition. Fix tests to check if the error messages are 
proper.

commit 77e4d6db1d647db7a7b2c13c922bab0bdd3e53fc
Author: Suchith J N 
Date:   2018-01-21T06:21:20Z

[SPARK-22954][SQL] Reorganize imports to satisfy Scalastyle.

commit 4d4e3fe9cced139efc8f162a7a15527b641c
Author: Suchith J N 
Date:   2018-01-21T06:36:33Z

[SPARK-22954][SQL] Removed some extraneous whitespace.

commit 4c8645623f3b89c9f7b1bc7809c6b9f5a95d2389
Author: Suchith J N 
Date:   2018-01-30T03:56:43Z

[SPARK-22954][SQL] Add test case to make sure that calling analyze 
partition on view throws AnalyzeException telling that it isn't supported on 
views.




---

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



[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-05-18 Thread suchithjn225
Github user suchithjn225 closed the pull request at:

https://github.com/apache/spark/pull/20177


---

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



[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-01-19 Thread jiangxb1987
Github user jiangxb1987 commented on a diff in the pull request:

https://github.com/apache/spark/pull/20177#discussion_r162749089
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala ---
@@ -154,11 +155,17 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
   assertNoSuchTable(s"TRUNCATE TABLE $viewName")
   assertNoSuchTable(s"SHOW CREATE TABLE $viewName")
   assertNoSuchTable(s"SHOW PARTITIONS $viewName")
-  assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS")
-  assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS FOR 
COLUMNS id")
+  assertAnalysisException(s"ANALYZE TABLE $viewName COMPUTE 
STATISTICS")
--- End diff --

We should also check the error message to ensure the `AnalysisException` is 
not thrown from elsewhere.


---

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



[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-01-19 Thread jiangxb1987
Github user jiangxb1987 commented on a diff in the pull request:

https://github.com/apache/spark/pull/20177#discussion_r162746808
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/AnalyzeTableCommand.scala
 ---
@@ -31,9 +31,9 @@ case class AnalyzeTableCommand(
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
 val sessionState = sparkSession.sessionState
-val db = 
tableIdent.database.getOrElse(sessionState.catalog.getCurrentDatabase)
-val tableIdentWithDB = TableIdentifier(tableIdent.table, Some(db))
-val tableMeta = sessionState.catalog.getTableMetadata(tableIdentWithDB)
+val db = tableIdent.database
+val tableIdentWithDB = TableIdentifier(tableIdent.table, db)
+val tableMeta = 
sessionState.catalog.getTempViewOrPermanentTableMetadata(tableIdentWithDB)
--- End diff --

Wouldn't this fail if we have a table that neglect the current database in 
tableIdent?


---

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



[GitHub] spark pull request #20177: [SPARK-22954][SQL] Fix the exception thrown by An...

2018-01-07 Thread suchithjn225
GitHub user suchithjn225 opened a pull request:

https://github.com/apache/spark/pull/20177

[SPARK-22954][SQL] Fix the exception thrown by Analyze command on temporary 
views to throw AnalysisException

## What changes were proposed in this pull request?
Previously running ANALYZE on temporary views produced NoSuchTableException 
even though the view was present. It is misleading. So it has to be changed to 
throw AnalysisException since it comes in the analysis part. 

## How was this patch tested?
Some unit tests were fixed to intercept AnalysisException instead of 
NoSuchTableException.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/suchithjn225/spark SPARK-22954-SQL

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/20177.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #20177


commit 8e92e6c26f61ac1999d76993756b8c696e487165
Author: Suchith J N 
Date:   2018-01-05T21:46:20Z

[SPARK-22954][SQL] Fixed the problem where temporary views were not looked 
up by session state's catalog.

commit 4de6ac840a6b8cbd7c5795b023783b626b21a9f4
Author: Suchith J N 
Date:   2018-01-06T19:01:37Z

[SPARK-22954][SQL] Fixed database name lookup so that None is returned 
instead of Some('default')

commit 98b8711cdd26c25fd774f77f46fc9e395ee2cffe
Author: Suchith J N 
Date:   2018-01-07T10:09:33Z

[SPARK-22954][SQL] Fixed the test to test for AnalysisException instead of 
NoSuchTableException




---

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