ajantha-bhat commented on a change in pull request #3196: [CARBONDATA-3366] Support SDK reader to read blocklet level split
URL:
https://github.com/apache/carbondata/pull/3196#discussion_r283631882
##########
File path: store/sdk/src/test/java/org/apache/carbondata/sdk/file/CarbonReaderTest.java
##########
@@ -2418,4 +2419,36 @@ public void testWriteWithDifferentDataType() {
}
}
}
+
+ @Test
+ public void testReadBlocklet() throws IOException, InterruptedException {
+ String path = "./testWriteFiles/" + System.nanoTime();
+ 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(1000 * 1000, new Schema(fields), path, null, 1, 100);
+
+ InputSplit[] splits = CarbonReader.builder(path).getSplits();
+ // check for 3 blocklet count (as only one carbon file will be created)
+ Assert.assertEquals(splits.length, 3);
+
+ int totalCount = 0;
+ for (int k = 0; k < splits.length; k++) {
+ CarbonReader reader = CarbonReader
+ .builder(path, "_temp")
Review comment:
I have changed the interface of builder() to take split and made buildWithSplits() as private now.
Refer the same testcase for the latest interface usage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]
With regards,
Apache Git Services