[ 
https://issues.apache.org/jira/browse/HIVE-25566?focusedWorklogId=656767&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-656767
 ]

ASF GitHub Bot logged work on HIVE-25566:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Sep/21 20:17
            Start Date: 28/Sep/21 20:17
    Worklog Time Spent: 10m 
      Work Description: soumyakanti3578 opened a new pull request #2678:
URL: https://github.com/apache/hive/pull/2678


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Column constraints are added with the data type to increase readability.
   
   
   ### Why are the changes needed?
   Improves readability.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   mvn test  -Dtest=TestMiniLlapLocalCliDriver -Dtest.output.overwrite=true 
-Dqfile=show_create_table.q
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 656767)
    Time Spent: 20m  (was: 10m)

> Show column constraints for "DESC FORMATTED TABLE"
> --------------------------------------------------
>
>                 Key: HIVE-25566
>                 URL: https://issues.apache.org/jira/browse/HIVE-25566
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Soumyakanti Das
>            Assignee: Soumyakanti Das
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, column constraints are not shown with the data type of columns. 
> They are shown all together at the end, but showing them with the data type 
> will make the description more readable.
>  
> Example:
> Create table
>   
> {code:java}
> CREATE TABLE TEST(
>   col1 varchar(100) NOT NULL COMMENT "comment for column 1",
>   col2 timestamp DEFAULT CURRENT_TIMESTAMP() COMMENT "comment for column 2",
>   col3 decimal,
>   col4 varchar(512) NOT NULL,
>   col5 varchar(100),
>   primary key(col1, col2) disable novalidate)
> ROW FORMAT SERDE
>   'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
> STORED AS INPUTFORMAT
>   'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
> OUTPUTFORMAT
>   'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
> {code}
>  
> Currently, {{DESC FORMATTED TABLE }} returns,
> {code:java}
> # col_name                    data_type               comment             
> col1                  varchar(100)    comment for column 1
> col2                  timestamp       comment for column 2
> col3                  decimal(10,0)                               
> col4                  varchar(512)                        
> col5                  varchar(100)                                
> # Detailed Table Information           
> Database:             default                  
> #### A masked pattern was here ####
> Retention:            0                        
> #### A masked pattern was here ####
> Table Type:           MANAGED_TABLE            
> Table Parameters:              
>       COLUMN_STATS_ACCURATE   
> {\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"col1\":\"true\",\"col2\":\"true\",\"col3\":\"true\",\"col4\":\"true\",\"col5\":\"true\"}}
>       bucketing_version       2                   
>       numFiles                0                   
>       numRows                 0                   
>       rawDataSize             0                   
>       totalSize               0                   
> #### A masked pattern was here ####
> # Storage Information          
> SerDe Library:        org.apache.hadoop.hive.ql.io.orc.OrcSerde        
> InputFormat:          org.apache.hadoop.hive.ql.io.orc.OrcInputFormat  
> OutputFormat:         org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat        
>  
> Compressed:           No                       
> Num Buckets:          -1                       
> Bucket Columns:       []                       
> Sort Columns:         []                       
> Storage Desc Params:           
>       serialization.format    1                   
> # Constraints          
> # Primary Key          
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col1                     
> Column Name:          col2                     
> # Not Null Constraints                 
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col1                     
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col4                     
> # Default Constraints          
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:col2      Default Value:CURRENT_TIMESTAMP()       
> {code}
>  
> Adding the column constraints will look something like,
> {code:java}
> # col_name                    data_type                                       
>         comment             
> col1                  varchar(100) PRIMARY KEY NOT NULL                       
> comment for column 1
> col2                  timestamp PRIMARY KEY DEFAULT CURRENT_TIMESTAMP()       
> comment for column 2
> col3                  decimal(10,0)                               
> col4                  varchar(512) NOT NULL                       
> col5                  varchar(100)                                
> # Detailed Table Information           
> Database:             default                  
> #### A masked pattern was here ####
> Retention:            0                        
> #### A masked pattern was here ####
> Table Type:           MANAGED_TABLE            
> Table Parameters:              
>       COLUMN_STATS_ACCURATE   
> {\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"col1\":\"true\",\"col2\":\"true\",\"col3\":\"true\",\"col4\":\"true\",\"col5\":\"true\"}}
>       bucketing_version       2                   
>       numFiles                0                   
>       numRows                 0                   
>       rawDataSize             0                   
>       totalSize               0                   
> #### A masked pattern was here ####
> # Storage Information          
> SerDe Library:        org.apache.hadoop.hive.ql.io.orc.OrcSerde        
> InputFormat:          org.apache.hadoop.hive.ql.io.orc.OrcInputFormat  
> OutputFormat:         org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat        
>  
> Compressed:           No                       
> Num Buckets:          -1                       
> Bucket Columns:       []                       
> Sort Columns:         []                       
> Storage Desc Params:           
>       serialization.format    1                   
> # Constraints          
> # Primary Key          
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col1                     
> Column Name:          col2                     
> # Not Null Constraints                 
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col1                     
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:          col4                     
> # Default Constraints          
> Table:                default.test             
> Constraint Name:      #### A masked pattern was here ####      
> Column Name:col2      Default Value:CURRENT_TIMESTAMP()       
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to