xubo245 commented on a change in pull request #3526: [CARBONDATA-3627] C++ SDK 
support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#discussion_r363102484
 
 

 ##########
 File path: store/CSDK/test/main.cpp
 ##########
 @@ -740,6 +740,130 @@ bool testWriteData(JNIEnv *env, char *path, int argc, 
char *argv[]) {
     }
 }
 
+bool testWriteDataWithSchemaFile(JNIEnv *env, char *path, int argc, char 
*argv[]) {
+
+    try {
+        CarbonWriter writer;
+        writer.builder(env);
+        writer.outputPath(path);
+        writer.withCsvInput();
+        
writer.withSchemaFile("../../../integration/spark-common/target/warehouse/add_segment_test/Metadata/schema");
+        writer.writtenBy("CSDK");
+        writer.taskNo(15541554.81);
+        writer.withThreadSafe(1);
+        writer.uniqueIdentifier(1549911814000000);
+        writer.withBlockSize(1);
+        writer.withBlockletSize(16);
+        writer.enableLocalDictionary(true);
+        writer.localDictionaryThreshold(10000);
+        if (argc > 3) {
+            writer.withHadoopConf("fs.s3a.access.key", argv[1]);
+            writer.withHadoopConf("fs.s3a.secret.key", argv[2]);
+            writer.withHadoopConf("fs.s3a.endpoint", argv[3]);
+        }
+        writer.build();
+
+        int rowNum = 10;
+        int size = 14;
+        long longValue = 0;
+        double doubleValue = 0;
+        float floatValue = 0;
+        jclass objClass = env->FindClass("java/lang/String");
+        for (int i = 0; i < rowNum; ++i) {
+            jobjectArray arr = env->NewObjectArray(size, objClass, 0);
+            char ctrInt[10];
+            gcvt(i, 10, ctrInt);
+
+            char a[15] = "robot";
+            strcat(a, ctrInt);
+
+
 
 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to