You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by akashrn5 <gi...@git.apache.org> on 2019/01/02 06:46:33 UTC

[GitHub] carbondata pull request #3044: [CARBONDATA-3202]Documentation for alter tabl...

GitHub user akashrn5 opened a pull request:

    https://github.com/apache/carbondata/pull/3044

    [CARBONDATA-3202]Documentation for alter table column rename

    Add coumentation  for alter table column rename
    
    Be sure to do all of the following checklist to help us incorporate 
    your contribution quickly and easily:
    
     - [x] Any interfaces changed?
     NA
     - [x] Any backward compatibility impacted?
     NA
     - [x] Document update required?
    YES
     - [x] Testing done
    NA
            Please provide details on 
            - Whether new unit test cases have been added or why no new tests are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance test report.
            - Any additional information to help reviewers in testing this change.
           
     - [x] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
    


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

    $ git pull https://github.com/akashrn5/incubator-carbondata alter_doc

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

    https://github.com/apache/carbondata/pull/3044.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 #3044
    
----
commit 0c5df2ef11d3e7376e7a71ef79af56d6311b822f
Author: akashrn5 <ak...@...>
Date:   2019-01-02T06:39:05Z

    Documentation for alter table column rename

----


---

[GitHub] carbondata pull request #3044: [CARBONDATA-3202]Documentation for alter tabl...

Posted by qiuchenjian <gi...@git.apache.org>.
Github user qiuchenjian commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r244677596
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -681,24 +682,28 @@ Users can specify which columns to include and exclude for local dictionary gene
     
          **NOTE:** Drop Complex child column is not supported.
     
    -   - ##### CHANGE DATA TYPE
    +   - ##### RENAME COLUMN AND CHANGE DATATYPE
        
    -     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher.
    +     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher and rename column.
          Change of decimal data type from lower precision to higher precision will only be supported for cases where there is no data loss.
     
          ```
    -     ALTER TABLE [db_name.]table_name CHANGE col_name col_name changed_column_type
    +     ALTER TABLE [db_name.]table_name CHANGE old_col_name new_col_name column_data_type
          ```
    +     Scenarios:
    +     - If both the old and new column name are same, it is just a datatype change operation
    --- End diff --
    
    ```suggestion
         - If both the old and new column names are the same, it is just a datatype change operation
    ```


---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10362/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by SteNicholas <gi...@git.apache.org>.
Github user SteNicholas commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    @akashrn5 This document doesn't mention about comment of “alter table column rename”.Is document missing this point?And Spark 2.1 version couldn't support comment when alter table column rename.


---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by SteNicholas <gi...@git.apache.org>.
Github user SteNicholas commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    @akashrn5 Yeah,for example
    ````
    ALTER TABLE [db_name.]table_name CHANGE old_col_name new_col_name column_data_type comment ' '
    ````
    Spark 2.1 couldn't support column coment after column rename.
    [[BACKPORT] [SPARK-23525] [SQL] Support ALTER TABLE CHANGE COLUMN COMMENT for external hive table](https://github.com/apache/spark/pull/20768?from=singlemessage&isappinstalled=0)


---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2367/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2314/



---

[GitHub] carbondata pull request #3044: [CARBONDATA-3149]Documentation for alter tabl...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r245224509
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -681,24 +682,24 @@ Users can specify which columns to include and exclude for local dictionary gene
     
          **NOTE:** Drop Complex child column is not supported.
     
    -   - ##### CHANGE DATA TYPE
    +   - ##### CHANGE COLUMN NAME/TYPE
        
    -     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher.
    +     This command is used to change the column's name and the data type from INT to BIGINT or decimal precision from lower to higher and rename column.
    --- End diff --
    
    Write this as below
    `This command is used to change column name and the data type from INT to BIGINT or decimal precision from lower to higher.`


---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    LGTM


---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by akashrn5 <gi...@git.apache.org>.
Github user akashrn5 commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    @SteNicholas i did not get your point correctly, basicaly you are telling that,
    
    1. column coment after column rename ?
    2. whether spark 2.1 supports column rename?
    
    am i right? if not, please can you explain it corectly, so that i can clear your doubt


---

[GitHub] carbondata pull request #3044: [CARBONDATA-3202]Documentation for alter tabl...

Posted by qiuchenjian <gi...@git.apache.org>.
Github user qiuchenjian commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r244676690
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -681,24 +682,28 @@ Users can specify which columns to include and exclude for local dictionary gene
     
          **NOTE:** Drop Complex child column is not supported.
     
    -   - ##### CHANGE DATA TYPE
    +   - ##### RENAME COLUMN AND CHANGE DATATYPE
        
    -     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher.
    +     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher and rename column.
          Change of decimal data type from lower precision to higher precision will only be supported for cases where there is no data loss.
     
          ```
    -     ALTER TABLE [db_name.]table_name CHANGE col_name col_name changed_column_type
    +     ALTER TABLE [db_name.]table_name CHANGE old_col_name new_col_name column_data_type
          ```
    +     Scenarios:
    +     - If both the old and new column name are same, it is just a datatype change operation
    +     - If the old column name and new column name are different and datatype is column's source datatype, it is just a column rename operation else it is both column rename and
    +     datatype change operation.
     
          Valid Scenarios
          - Invalid scenario - Change of decimal precision from (10,2) to (10,5) is invalid as in this case only scale is increased but total number of digits remains the same.
          - Valid scenario - Change of decimal precision from (10,2) to (12,3) is valid as the total number of digits are increased by 2 but scale is increased only by 1 which will not lead to any data loss.
          - **NOTE:** The allowed range is 38,38 (precision, scale) and is a valid upper case scenario which is not resulting in data loss.
     
    -     Example1:Changing data type of column a1 from INT to BIGINT.
    +     Example1:Rename column a1 to a2 and changing data type from INT to BIGINT.
    --- End diff --
    
    ```suggestion
         Example1:Rename column a1 to a2 and change data type from INT to BIGINT.
    ```


---

[GitHub] carbondata pull request #3044: [CARBONDATA-3149]Documentation for alter tabl...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/3044


---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2374/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10415/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2109/



---

[GitHub] carbondata pull request #3044: [CARBONDATA-3149]Documentation for alter tabl...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r245224386
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -47,7 +47,8 @@ CarbonData DDL statements are documented here,which includes:
         * [RENAME TABLE](#rename-table)
         * [ADD COLUMNS](#add-columns)
         * [DROP COLUMNS](#drop-columns)
    -    * [CHANGE DATA TYPE](#change-data-type)
    +    * [RENAME COLUMN](#change-column-name-/-type)
    +    * [CHANGE DATA TYPE](#change-column-name-/-type)
    --- End diff --
    
    check for linking. With this text it will not link


---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10363/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2313/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3202]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2108/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2154/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10408/



---

[GitHub] carbondata issue #3044: [CARBONDATA-3149]Documentation for alter table colum...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/3044
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2161/



---

[GitHub] carbondata pull request #3044: [CARBONDATA-3149]Documentation for alter tabl...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r245224565
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -681,24 +682,24 @@ Users can specify which columns to include and exclude for local dictionary gene
     
          **NOTE:** Drop Complex child column is not supported.
     
    -   - ##### CHANGE DATA TYPE
    +   - ##### CHANGE COLUMN NAME/TYPE
        
    -     This command is used to change the data type from INT to BIGINT or decimal precision from lower to higher.
    +     This command is used to change the column's name and the data type from INT to BIGINT or decimal precision from lower to higher and rename column.
          Change of decimal data type from lower precision to higher precision will only be supported for cases where there is no data loss.
     
          ```
    -     ALTER TABLE [db_name.]table_name CHANGE col_name col_name changed_column_type
    +     ALTER TABLE [db_name.]table_name CHANGE old_col_name new_col_name column_data_type
    --- End diff --
    
    Change this as below
    `ALTER TABLE [db_name.]table_name CHANGE col_old_name col_new_name column_type`


---

[GitHub] carbondata pull request #3044: [CARBONDATA-3149]Documentation for alter tabl...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3044#discussion_r244919178
  
    --- Diff: docs/ddl-of-carbondata.md ---
    @@ -681,24 +682,28 @@ Users can specify which columns to include and exclude for local dictionary gene
     
          **NOTE:** Drop Complex child column is not supported.
     
    -   - ##### CHANGE DATA TYPE
    +   - ##### RENAME COLUMN AND CHANGE DATATYPE
    --- End diff --
    
    Change this to `Change Column Name/Type`. Please go through the below link and try to align the documentation in that way if possible
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-ChangeColumnName/Type/Position/Comment


---