GitHub user skambha opened a pull request:

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

    [SPARK-16115][SQL] Change output schema to be partition for SHOW PARTITIONS 
command and …

    ## What changes were proposed in this pull request?
    
    Changes include: 
    1. For the SHOW PARTITIONS command, the column name in the output is 
changed from 'result' to 'partition' as it is more descriptive.  This is now 
similar to Hive.
    
    2. Corner case: Improve the error message when calling show partitions on a 
non-existent table. 
    Add a check to see if table exists or not and add error message.
    
    Without the fix: 
    scala> spark.sql("show partitions t1");
    org.apache.spark.sql.AnalysisException: SHOW PARTITIONS is not allowed on a 
table that is not partitioned: default.t1;
    
    With the fix: 
    scala> spark.sql("SHOW PARTITIONS T1").show;
    org.apache.spark.sql.AnalysisException:  Table does not exist;
    
    ## How was this patch tested?
    - Added unit tests to cover these two scenarios
    - Following unit tests were run successfully:  hive/test, sql/test, 
catalyst/test

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

    $ git pull https://github.com/skambha/spark showpart16115

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

    https://github.com/apache/spark/pull/13822.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 #13822
    
----

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to