You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by xubo245 <gi...@git.apache.org> on 2018/05/24 02:00:19 UTC
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
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 <xu...@...>
Date: 2018-05-24T01:33:23Z
[CARBONDATA-2524] Support create carbonReader with default projection
commit 9c4c37ba204e5856939183153d777b460e49f30e
Author: xubo245 <xu...@...>
Date: 2018-05-23T10:50:46Z
projection supprt *
commit 9149c0515a743482bf81a61a44c28e0200f0d02f
Author: xubo245 <xu...@...>
Date: 2018-05-24T01:57:26Z
add projectAllColumns
----
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/5120/
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/carbondata/pull/2338
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:
https://github.com/apache/carbondata/pull/2338
LGTM
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/4952/
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by kunal642 <gi...@git.apache.org>.
Github user kunal642 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191174415
--- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java ---
@@ -61,6 +64,33 @@ public CarbonReaderBuilder projection(String[] projectionColumnNames) {
return this;
}
+ /**
+ * All Columns need to be Projected
+ *
+ * @return CarbonReaderBuilder object
+ * @throws IOException
+ */
+ public CarbonReaderBuilder projectAllColumns() throws IOException {
--- End diff --
can you add a description for this method in reader document
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/4971/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by sounakr <gi...@git.apache.org>.
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[]{})
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by sounakr <gi...@git.apache.org>.
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.
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/5119/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2338
retest this please
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/4968/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/5123/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2338
@sounakr Done, CI pass.
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on the issue:
https://github.com/apache/carbondata/pull/2338
retest this please
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2338#discussion_r191176382
--- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReaderBuilder.java ---
@@ -61,6 +64,33 @@ public CarbonReaderBuilder projection(String[] projectionColumnNames) {
return this;
}
+ /**
+ * All Columns need to be Projected
+ *
+ * @return CarbonReaderBuilder object
+ * @throws IOException
+ */
+ public CarbonReaderBuilder projectAllColumns() throws IOException {
--- End diff --
ok, done
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by xubo245 <gi...@git.apache.org>.
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);
}
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/6135/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/6130/
---
[GitHub] carbondata issue #2338: [CARBONDATA-2524] Support create carbonReader with d...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata pull request #2338: [CARBONDATA-2524] Support create carbonReader...
Posted by xubo245 <gi...@git.apache.org>.
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.
---