[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
GitHub user akashrn5 opened a pull request:

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

    [CARBONDATA-3060]Improve the command for cli and fixed other issues

    ### Changes proposed in this PR:
   
    **1. improve the syntax for CLI DDL, now the command can be given as**
    `CarbonCli for table <table_name> options('-cmd summary/benchmark    -a  -s  -v  -c <column_name> -m')`
   
    the options will take one string, which is basically a command, which user can directly paste into command promt and run as java command
    Now user no nned to give -P also, internally when above commad is run we take table path into consideration in command line arguments
   
    **2. other issues are fixed in this PR are**
    1. when numeric columns are included in dictionary
    2. timestamp column's min and max details
    3. help command was not working in beeline
    4. for all the complex columns, like parent and child columns, min and max will be given as "NA"
   
   
   
   
    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
   
     - [ ] Testing done
            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.
           
     - [ ] 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 improve

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

    https://github.com/apache/carbondata/pull/2882.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 #2882
   
----
commit ca8061e1d6e0652c786c1231ad82efe17e504ee4
Author: akashrn5 <akashnilugal@...>
Date:   2018-10-29T12:44:24Z

    Improve the command for cli and fixed other issues

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229276851
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java ---
    @@ -314,23 +312,26 @@ private void printColumnStats(String columnName) throws IOException, MemoryExcep
               minPercent = String.format("%.1f", blocklet.getColumnChunk().getMinPercentage() * 100);
               maxPercent = String.format("%.1f", blocklet.getColumnChunk().getMaxPercentage() * 100);
               DataFile.ColumnChunk columnChunk = blocklet.columnChunk;
    -          if (columnChunk.column.isDimensionColumn() && DataTypeUtil
    +          if (columnChunk.column.hasEncoding(Encoding.DICTIONARY) || blocklet
    +              .getColumnChunk().column.getColumnName().contains(".val") || blocklet
    --- End diff --
   
    what column is it? can you make it more readable?


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229278160
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataFile.java ---
    @@ -443,7 +444,8 @@ void computePercentage(byte[] shardMin, byte[] shardMax) {
          * @return result
          */
         private double computePercentage(byte[] data, byte[] min, byte[] max, ColumnSchema column) {
    -      if (column.getDataType() == DataTypes.STRING) {
    +      if (column.getDataType() == DataTypes.STRING || column.getDataType() == DataTypes.BOOLEAN
    +          || column.hasEncoding(Encoding.DICTIONARY)) {
    --- End diff --
   
    dictionary column still have min max right?


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229278322
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataFile.java ---
    @@ -453,7 +455,16 @@ private double computePercentage(byte[] data, byte[] min, byte[] max, ColumnSche
             return dataValue.divide(factorValue).doubleValue();
           }
           double dataValue, minValue, factorValue;
    -      if (column.getDataType() == DataTypes.SHORT) {
    +      if (columnChunk.column.isDimensionColumn() && DataTypeUtil
    --- End diff --
   
     move `DataTypeUtil` to next column


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229297954
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataFile.java ---
    @@ -443,7 +444,8 @@ void computePercentage(byte[] shardMin, byte[] shardMax) {
          * @return result
          */
         private double computePercentage(byte[] data, byte[] min, byte[] max, ColumnSchema column) {
    -      if (column.getDataType() == DataTypes.STRING) {
    +      if (column.getDataType() == DataTypes.STRING || column.getDataType() == DataTypes.BOOLEAN
    +          || column.hasEncoding(Encoding.DICTIONARY)) {
    --- End diff --
   
    yes, but min max will be surrogate keys right, showing min and max as dictionary value is not useful right


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229300837
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java ---
    @@ -314,23 +312,26 @@ private void printColumnStats(String columnName) throws IOException, MemoryExcep
               minPercent = String.format("%.1f", blocklet.getColumnChunk().getMinPercentage() * 100);
               maxPercent = String.format("%.1f", blocklet.getColumnChunk().getMaxPercentage() * 100);
               DataFile.ColumnChunk columnChunk = blocklet.columnChunk;
    -          if (columnChunk.column.isDimensionColumn() && DataTypeUtil
    +          if (columnChunk.column.hasEncoding(Encoding.DICTIONARY) || blocklet
    +              .getColumnChunk().column.getColumnName().contains(".val") || blocklet
    --- End diff --
   
    this will be for no dictionary colmplex column, for complex column min max can be shown as NA, that will be ok right


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2882
 
    Build Success with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9421/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2882
 
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1377/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2882
 
    Build Success with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9457/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229961572
 
    --- Diff: examples/spark2/src/main/java/org/apache/carbondata/examples/sdk/CarbonReaderExample.java ---
    @@ -61,7 +61,7 @@ public static void main(String[] args) {
                 CarbonWriter writer = CarbonWriter.builder()
                     .outputPath(path)
                     .withLoadOptions(map)
    -                .withCsvInput(new Schema(fields)).build();
    +                .withCsvInput(new Schema(fields)).writtenBy("CarbonReaderExample").build();
    --- End diff --
   
    move `writtenBy` to next line


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r229961679
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java ---
    @@ -314,23 +312,26 @@ private void printColumnStats(String columnName) throws IOException, MemoryExcep
               minPercent = String.format("%.1f", blocklet.getColumnChunk().getMinPercentage() * 100);
               maxPercent = String.format("%.1f", blocklet.getColumnChunk().getMaxPercentage() * 100);
               DataFile.ColumnChunk columnChunk = blocklet.columnChunk;
    -          if (columnChunk.column.isDimensionColumn() && DataTypeUtil
    +          if (columnChunk.column.hasEncoding(Encoding.DICTIONARY) || blocklet
    +              .getColumnChunk().column.getColumnName().contains(".val") || blocklet
    --- End diff --
   
    please make correct line wrapping, move `blocklet` to next line


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r230319095
 
    --- Diff: examples/spark2/src/main/java/org/apache/carbondata/examples/sdk/CarbonReaderExample.java ---
    @@ -61,7 +61,7 @@ public static void main(String[] args) {
                 CarbonWriter writer = CarbonWriter.builder()
                     .outputPath(path)
                     .withLoadOptions(map)
    -                .withCsvInput(new Schema(fields)).build();
    +                .withCsvInput(new Schema(fields)).writtenBy("CarbonReaderExample").build();
    --- End diff --
   
    done


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2882: [CARBONDATA-3060]Improve the command for cli ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2882#discussion_r230319129
 
    --- Diff: tools/cli/src/main/java/org/apache/carbondata/tool/DataSummary.java ---
    @@ -314,23 +312,26 @@ private void printColumnStats(String columnName) throws IOException, MemoryExcep
               minPercent = String.format("%.1f", blocklet.getColumnChunk().getMinPercentage() * 100);
               maxPercent = String.format("%.1f", blocklet.getColumnChunk().getMaxPercentage() * 100);
               DataFile.ColumnChunk columnChunk = blocklet.columnChunk;
    -          if (columnChunk.column.isDimensionColumn() && DataTypeUtil
    +          if (columnChunk.column.hasEncoding(Encoding.DICTIONARY) || blocklet
    +              .getColumnChunk().column.getColumnName().contains(".val") || blocklet
    --- End diff --
   
    done


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2882: [CARBONDATA-3060]Improve the command for cli and fix...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



---
12