GitHub user xubo245 opened a pull request:
https://github.com/apache/carbondata/pull/2338 [CARBONDATA-2524] Support create carbonReader with default projection 1.Support create carbonReader with default projection 2.Add projectAllColumns method 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? NO - [ ] 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. Yes, add some test case. - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. No You can merge this pull request into a Git repository by running: $ git pull https://github.com/xubo245/carbondata CARBONDATA-2524-CarbonReaderWithDefaultProjection Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/2338.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 #2338 ---- commit 0df9664bed67d6da67369843e39e017280437356 Author: xubo245 <xubo29@...> Date: 2018-05-24T01:33:23Z [CARBONDATA-2524] Support create carbonReader with default projection commit 9c4c37ba204e5856939183153d777b460e49f30e Author: xubo245 <xubo29@...> Date: 2018-05-23T10:50:46Z projection supprt * commit 9149c0515a743482bf81a61a44c28e0200f0d02f Author: xubo245 <xubo29@...> Date: 2018-05-24T01:57:26Z add projectAllColumns ---- --- |
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2338 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5081/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6082/ --- |
In reply to this post by qiuchenjian-2
Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2338 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4922/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2338 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5083/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4927/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6088/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2338 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5103/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6109/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4947/ --- |
In reply to this post by qiuchenjian-2
Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2338 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6111/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4950/ --- |
In reply to this post by qiuchenjian-2
Github user sounakr commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191094718 --- Diff: store/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java --- @@ -409,4 +409,76 @@ public boolean accept(File pathname) { badRecordLoc); } + @Test + public void testReadFilesWithProjectAllColumns() throws IOException, InterruptedException { + String path = "./testWriteFiles"; + FileUtils.deleteDirectory(new File(path)); + + Field[] fields = new Field[2]; + fields[0] = new Field("name", DataTypes.STRING); + fields[1] = new Field("age", DataTypes.INT); + + TestUtil.writeFilesAndVerify(new Schema(fields), path, true); + + CarbonReader reader = CarbonReader + .builder(path, "_temp") + .projectAllColumns() --- End diff -- Please add a test case pass null string to projection API. for e.g. .projection(new String[]{}) --- |
In reply to this post by qiuchenjian-2
Github user sounakr commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191094883 --- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java --- @@ -152,9 +179,10 @@ public CarbonReaderBuilder setEndPoint(String value) { if (filterExpression != null) { format.setFilterPredicates(job.getConfiguration(), filterExpression); } - if (projectionColumns != null) { - format.setColumnProjection(job.getConfiguration(), new CarbonProjection(projectionColumns)); + if (projectionColumns == null) { --- End diff -- Rather than checking projectionColumns better to set a member variable like projectAllColumns when projectAllColumns() API is being used. Only incase projectAllColumns is show all columns. projectionColumns can be null in many other cases also. --- |
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191096462 --- Diff: store/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java --- @@ -409,4 +409,76 @@ public boolean accept(File pathname) { badRecordLoc); } + @Test + public void testReadFilesWithProjectAllColumns() throws IOException, InterruptedException { + String path = "./testWriteFiles"; + FileUtils.deleteDirectory(new File(path)); + + Field[] fields = new Field[2]; + fields[0] = new Field("name", DataTypes.STRING); + fields[1] = new Field("age", DataTypes.INT); + + TestUtil.writeFilesAndVerify(new Schema(fields), path, true); + + CarbonReader reader = CarbonReader + .builder(path, "_temp") + .projectAllColumns() --- End diff -- ok, done. It return null object. --- |
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191097577 --- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java --- @@ -152,9 +179,10 @@ public CarbonReaderBuilder setEndPoint(String value) { if (filterExpression != null) { format.setFilterPredicates(job.getConfiguration(), filterExpression); } - if (projectionColumns != null) { - format.setColumnProjection(job.getConfiguration(), new CarbonProjection(projectionColumns)); + if (projectionColumns == null) { --- End diff -- If changed like you said, it will not support this build method : CarbonReader reader = CarbonReader .builder(path, "_temp") .build(); Test case: @Test public void testReadFilesWithDefaultProjection() throws IOException, InterruptedException { String path = "./testWriteFiles"; FileUtils.deleteDirectory(new File(path)); Field[] fields = new Field[2]; fields[0] = new Field("name", DataTypes.STRING); fields[1] = new Field("age", DataTypes.INT); TestUtil.writeFilesAndVerify(new Schema(fields), path, true); CarbonReader reader = CarbonReader .builder(path, "_temp") .build(); // expected output after sorting String[] name = new String[100]; int[] age = new int[100]; for (int i = 0; i < 100; i++) { name[i] = "robot" + (i / 10); age[i] = (i % 10) * 10 + i / 10; } // Default sort column is applied for dimensions. So, need to validate accordingly int i = 0; while (reader.hasNext()) { Object[] row = (Object[]) reader.readNextRow(); // Default sort column is applied for dimensions. So, need to validate accordingly Assert.assertEquals(name[i], row[0]); Assert.assertEquals(age[i], row[1]); i++; } Assert.assertEquals(i, 100); } --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2338 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5107/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2338 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/6114/ --- |
Free forum by Nabble | Edit this page |