[GitHub] carbondata pull request #1678: [CARBONDATA-1903] optimize code in carbondata

classic Classic list List threaded Threaded
76 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] optimize code in carbondata

qiuchenjian-2
GitHub user xuchuanyin opened a pull request:

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

    [CARBONDATA-1903] optimize code in carbondata

    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [x] Any interfaces changed?
        `No`
     - [x] Any backward compatibility impacted?
        `No`
     - [x] Document update required?
        `No`
     - [x] Testing done
            Please provide details on
            - Whether new unit test cases have been added or why no new tests are required?
            `No, only fixed code related issues.`
            - How it is tested? Please attach test report.
            `Tested in local machine`
            - Is it a performance related change? Please attach the performance test report.
            `No, only fixed code related issues.`
            - Any additional information to help reviewers in testing this change.
            `No`
           
     - [x] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
            `Not related`
   
    Modification
    ===
   
    1. Remove unused code like `FileUtil`
   
    2. Fix/Optimize code issues in carbondata

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

    $ git pull https://github.com/xuchuanyin/carbondata opt_useless_code

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

    https://github.com/apache/carbondata/pull/1678.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 #1678
   
----
commit 5e5a7068c51532349503602c698e77da857a71b5
Author: xuchuanyin <[hidden email]>
Date:   2017-12-19T08:40:49Z

    optimize code in carbondata
   
    1. Remove unused code like `FileUtil`
   
    2. Fix/Optimize code issues in carbondata

----


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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2126/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/902/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2412/



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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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/1678#discussion_r157780318
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/indexstore/BlockletDataMapIndexStore.java ---
    @@ -134,9 +134,8 @@ public BlockletDataMap get(TableBlockIndexUniqueIdentifier identifier)
       @Override
       public BlockletDataMap getIfPresent(
           TableBlockIndexUniqueIdentifier tableSegmentUniqueIdentifier) {
    -    BlockletDataMap dataMap = (BlockletDataMap) lruCache
    +    return (BlockletDataMap) lruCache
             .get(tableSegmentUniqueIdentifier.getUniqueTableSegmentIdentifier());
    --- End diff --
   
    move .get to previous line


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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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/1678#discussion_r157780425
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataRefNodeWrapper.java ---
    @@ -124,11 +124,10 @@ public DimensionRawColumnChunk getDimensionChunk(FileHolder fileReader, int bloc
       private DimensionColumnChunkReader getDimensionColumnChunkReader() throws IOException {
         ColumnarFormatVersion version =
             ColumnarFormatVersion.valueOf(blockInfos.get(index).getDetailInfo().getVersionNumber());
    -    DimensionColumnChunkReader dimensionColumnChunkReader = CarbonDataReaderFactory.getInstance()
    +    return CarbonDataReaderFactory.getInstance()
             .getDimensionColumnChunkReader(version,
    --- End diff --
   
    move .getDimensionColumnChunkReader to previous line


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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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/1678#discussion_r157780989
 
    --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/util/SchemaReader.java ---
    @@ -75,9 +75,8 @@ public static TableInfo getTableInfo(AbsoluteTableIdentifier absoluteTableIdenti
             new ThriftWrapperSchemaConverterImpl();
         CarbonTableIdentifier carbonTableIdentifier =
             absoluteTableIdentifier.getCarbonTableIdentifier();
    -    TableInfo tableInfo = thriftWrapperSchemaConverter
    +    return thriftWrapperSchemaConverter
    --- End diff --
   
    change to
    ```
          foo(
           a,
           b,
           ...)
    ```


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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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/1678#discussion_r157781655
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java ---
    @@ -298,8 +298,7 @@ private void readAndLoadDataFromSortTempFiles() throws Exception {
             try {
               dataHandler.closeHandler();
             } catch (CarbonDataWriterException e) {
    -          LOGGER.error(e);
    -          throw new Exception("Problem loading data during compaction: " + e.getMessage());
    +          LOGGER.error(e, "Error in close data handler");
    --- End diff --
   
    not throwing exception to caller?


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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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

    https://github.com/apache/carbondata/pull/1678#discussion_r157920314
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java ---
    @@ -298,8 +298,7 @@ private void readAndLoadDataFromSortTempFiles() throws Exception {
             try {
               dataHandler.closeHandler();
             } catch (CarbonDataWriterException e) {
    -          LOGGER.error(e);
    -          throw new Exception("Problem loading data during compaction: " + e.getMessage());
    +          LOGGER.error(e, "Error in close data handler");
    --- End diff --
   
    It‘s better not to throw Exception in finally block, so we just swallow this exception.


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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2437/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/924/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2153/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2162/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/933/



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

[GitHub] carbondata pull request #1678: [CARBONDATA-1903] Fix code issues in carbonda...

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/1678#discussion_r157950581
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/merger/CompactionResultSortProcessor.java ---
    @@ -298,8 +298,7 @@ private void readAndLoadDataFromSortTempFiles() throws Exception {
             try {
               dataHandler.closeHandler();
             } catch (CarbonDataWriterException e) {
    -          LOGGER.error(e);
    -          throw new Exception("Problem loading data during compaction: " + e.getMessage());
    +          LOGGER.error(e, "Error in close data handler");
    --- End diff --
   
    I think it is better not to hide the exception even in finally block, there are multiple operations inside dataHandler.closeHandler(), let it throw exception to caller then we can know which operation cause the exception.
    In line 292, 295, 301, please modify to use `new Exception(msg, e) to include the original exception in the new exception.


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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    retest this please


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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    retest this please


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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2241/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1017/



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

[GitHub] carbondata issue #1678: [CARBONDATA-1903] Fix code issues in carbondata

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

    https://github.com/apache/carbondata/pull/1678
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2499/



---
1234