[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

qiuchenjian-2
GitHub user ndwangsen opened a pull request:

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

    [CARBONDATA-2804][DataMap] fix the bug when bloom filter or preaggregate datamap tried to be created on older V1-V2 version stores

    [CARBONDATA-2804] fix the bug when bloom filter or preaggregate datamap tried to be created on older V1-V2 version store
   
    fix the bug for read the carbondata format version form carbondata file header of the older V1-V2 version stores, the version filed is moved to FileHeader
   
    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [ ] Any interfaces changed?
     NA
     - [ ] Any backward compatibility impacted?
     NA
     - [ ] Document update required?
    NA
     - [ ] 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.
           test pass in test environment
     - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
    NA


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

    $ git pull https://github.com/ndwangsen/incubator-carbondata fix_block_dm_v1_v2

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

    https://github.com/apache/carbondata/pull/2601.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 #2601
   
----
commit 921c436b5d19421d68dc7085c9155608dfdb81e3
Author: ndwangsen <luffy.wang@...>
Date:   2018-08-02T08:21:22Z

    [CARBONDATA-2804] fix the bug when bloom filter or preaggregate datamap
   
    tried to be created on older V1-V2 version stores

----


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

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



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6457/



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

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


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7737/



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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207223659
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    --- End diff --
   
    Rename storePath to segmentPath


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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207225748
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    +      SegmentIndexFileStore fileStore = new SegmentIndexFileStore();
    +      fileStore.readAllIIndexOfSegment(storePath);
    +      Map<String, byte[]> carbonIndexMap = fileStore.getCarbonIndexMap();
    +      if (carbonIndexMap.size() == 0) {
    +        version = CarbonProperties.getInstance().getFormatVersion();
    +      }
    +      CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
    +      for (byte[] fileData : carbonIndexMap.values()) {
    +        indexReader.openThriftReader(fileData);
    +        IndexHeader indexHeader = indexReader.readIndexHeader();
    +        version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion());
    +        break;
    +      }
    +    } else {
    +      version = CarbonProperties.getInstance().getFormatVersion();
    --- End diff --
   
    1. This else condition is not required as for a valid segment its path will exist in the file system.
    2. If at all the path does not exist then read the version info from the next valid segment and log a warning that valid segment path does not exist in the system


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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207224591
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    +      SegmentIndexFileStore fileStore = new SegmentIndexFileStore();
    +      fileStore.readAllIIndexOfSegment(storePath);
    +      Map<String, byte[]> carbonIndexMap = fileStore.getCarbonIndexMap();
    +      if (carbonIndexMap.size() == 0) {
    +        version = CarbonProperties.getInstance().getFormatVersion();
    +      }
    +      CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
    +      for (byte[] fileData : carbonIndexMap.values()) {
    +        indexReader.openThriftReader(fileData);
    +        IndexHeader indexHeader = indexReader.readIndexHeader();
    +        version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion());
    +        break;
    --- End diff --
   
    once reading is complete close indexReader using try and finally block
    indexReader.closeThriftReader()


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6463/



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    hi, @ndwangsen Can you provide simple description about your solution in the PR description.


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6122/



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

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



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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207430964
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    --- End diff --
   
     modified according to review comments


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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207430989
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    +      SegmentIndexFileStore fileStore = new SegmentIndexFileStore();
    +      fileStore.readAllIIndexOfSegment(storePath);
    +      Map<String, byte[]> carbonIndexMap = fileStore.getCarbonIndexMap();
    +      if (carbonIndexMap.size() == 0) {
    +        version = CarbonProperties.getInstance().getFormatVersion();
    +      }
    +      CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
    +      for (byte[] fileData : carbonIndexMap.values()) {
    +        indexReader.openThriftReader(fileData);
    +        IndexHeader indexHeader = indexReader.readIndexHeader();
    +        version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion());
    +        break;
    --- End diff --
   
     modified according to review comments


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

[GitHub] carbondata pull request #2601: [CARBONDATA-2804][DataMap] fix the bug when b...

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

    https://github.com/apache/carbondata/pull/2601#discussion_r207430996
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
    @@ -3212,28 +3213,27 @@ public static ColumnarFormatVersion getFormatVersion(CarbonTable carbonTable)
           }
           storePath = carbonTable.getSegmentPath(validSegments.get(0).getSegmentNo());
         }
    -
    -    CarbonFile[] carbonFiles = FileFactory
    -        .getCarbonFile(storePath)
    -        .listFiles(new CarbonFileFilter() {
    -          @Override
    -          public boolean accept(CarbonFile file) {
    -            if (file == null) {
    -              return false;
    -            }
    -            return file.getName().endsWith("carbondata");
    -          }
    -        });
    -    if (carbonFiles == null || carbonFiles.length < 1) {
    -      return CarbonProperties.getInstance().getFormatVersion();
    +    // get the carbon index file header
    +    FileFactory.FileType fileType = FileFactory.getFileType(storePath);
    +    ColumnarFormatVersion version = null;
    +    if (FileFactory.isFileExist(storePath, fileType)) {
    +      SegmentIndexFileStore fileStore = new SegmentIndexFileStore();
    +      fileStore.readAllIIndexOfSegment(storePath);
    +      Map<String, byte[]> carbonIndexMap = fileStore.getCarbonIndexMap();
    +      if (carbonIndexMap.size() == 0) {
    +        version = CarbonProperties.getInstance().getFormatVersion();
    +      }
    +      CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
    +      for (byte[] fileData : carbonIndexMap.values()) {
    +        indexReader.openThriftReader(fileData);
    +        IndexHeader indexHeader = indexReader.readIndexHeader();
    +        version = ColumnarFormatVersion.valueOf((short)indexHeader.getVersion());
    +        break;
    +      }
    +    } else {
    +      version = CarbonProperties.getInstance().getFormatVersion();
    --- End diff --
   
     modified according to review comments


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

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


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6477/



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

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


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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

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



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

[GitHub] carbondata issue #2601: [CARBONDATA-2804][DataMap] fix the bug when bloom fi...

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

    https://github.com/apache/carbondata/pull/2601
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6478/



---
12