GitHub user gatorsmile opened a pull request:

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

    [SPARK-15215] [SQL] Fix Explain Parsing and Output

    #### What changes were proposed in this pull request?
    This PR is to address a few existing issues in Explain:
    - The `Explain` options `LOGICAL | FORMATTED | EXTENDED | CODEGEN` should 
not be 0 or more match. It should 0 or one match.
    - The option `LOGICAL` is not supported
    - The output of `Explain` contains a weird empty line when the output of 
analyzed plan is empty. For example:
      ```
      == Parsed Logical Plan ==
      CreateTable 
CatalogTable(`t`,CatalogTableType(MANAGED),CatalogStorageFormat(None,Some(org.apache.hadoop.mapred.TextInputFormat),Some(org.apache.hadoop.hive.ql.io.
  
HiveIgnoreKeyTextOutputFormat),None,false,Map()),List(CatalogColumn(col,int,true,None)),List(),List(),List(),-1,,1462725171656,-1,Map(),None,None,None),
 false
      
      == Analyzed Logical Plan ==
      
      CreateTable 
CatalogTable(`t`,CatalogTableType(MANAGED),CatalogStorageFormat(None,Some(org.apache.hadoop.mapred.TextInputFormat),Some(org.apache.hadoop.hive.ql.io.
  
HiveIgnoreKeyTextOutputFormat),None,false,Map()),List(CatalogColumn(col,int,true,None)),List(),List(),List(),-1,,1462725171656,-1,Map(),None,None,None),
 false
      
      == Optimized Logical Plan ==
      CreateTable 
CatalogTable(`t`,CatalogTableType(MANAGED),CatalogStorageFormat(None,Some(org.apache.hadoop.mapred.TextInputFormat),Some(org.apache.hadoop.hive.ql.io.
  
HiveIgnoreKeyTextOutputFormat),None,false,Map()),List(CatalogColumn(col,int,true,None)),List(),List(),List(),-1,,1462725171656,-1,Map(),None,None,None),
 false
      ...
      ```
    
    #### How was this patch tested?
    Added and modified a few test cases

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

    $ git pull https://github.com/gatorsmile/spark explainCreateTable

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

    https://github.com/apache/spark/pull/12991.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 #12991
    
----
commit ee7868ead2072b6fa056257694dd6f8b5d15cfed
Author: gatorsmile <[email protected]>
Date:   2016-05-08T16:23:23Z

    fix.

----


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