xubo245 commented on a change in pull request #3301:
URL:
https://github.com/apache/carbondata/pull/3301#discussion_r417728677##########
File path: sdk/sdk/src/test/java/org/apache/carbondata/sdk/file/CSVCarbonWriterTest.java
##########
@@ -676,4 +680,194 @@ public void testWithTableProperties() throws IOException {
}
}
+ @Test
+ public void testWritingAndReadingArrayString() throws IOException {
+ String path = "./testWriteFilesArrayString";
+ FileUtils.deleteDirectory(new File(path));
+
+ Field[] fields = new Field[4];
+ fields[0] = new Field("id", DataTypes.STRING);
+ fields[1] = new Field("source", DataTypes.STRING);
+ fields[2] = new Field("usage", DataTypes.STRING);
+
+ StructField[] stringFields = new StructField[1];
+ stringFields[0] = new StructField("stringField", DataTypes.STRING);
+
+ Field arrayType = new Field("annotations", "array", Arrays.asList(stringFields));
+ fields[3] = arrayType;
+ try {
+ CarbonWriterBuilder builder = CarbonWriter.builder().taskNo(5).outputPath(path);
+ CarbonWriter writer = builder.withCsvInput(new Schema(fields)).writtenBy("CSVCarbonWriterTest").build();
+ for (int i = 0; i < 15; i++) {
+ String[] row = new String[]{
+ "robot" + (i % 10),
+ String.valueOf(i),
+ String.valueOf(i + "." + i),
Review comment:
done
----------------------------------------------------------------
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]