xubo245 opened a new pull request #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526 C++ SDK support write data withSchemaFile, which can be used for add segment for transactional table Be sure to do all of the following checklist to help us incorporate your contribution quickly and easily: - [ ] Any interfaces changed? new interface in C++ SDK - [ ] Any backward compatibility impacted? No - [ ] Document update required? No need - [ ] Testing done added - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. No ---------------------------------------------------------------- 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 |
CarbonDataQA1 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-568283685 Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1249/ ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-568297674 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1270/ ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-568297676 Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1259/ ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
xubo245 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-570645693 @jackylk @zzcclp Please review it. ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
jackylk 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_r363096509 ########## 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: remove all empty lines ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
jackylk 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_r363096770 ########## 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); + + + jobject intField = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 0, intField); + + jobject stringField = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 1, stringField); + + + jobject string2Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 2, string2Field); + + + jobject timeField = env->NewStringUTF("2019-02-12 03:03:34"); + env->SetObjectArrayElement(arr, 3, timeField); + + + jobject int4Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 4, int4Field); + + jobject string5Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 5, string5Field); + + jobject int6Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 6, int6Field); + + jobject string7Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 7, string7Field); + + jobject int8Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 8, int8Field); + + jobject time9Field = env->NewStringUTF("2019-02-12 03:03:34"); + env->SetObjectArrayElement(arr, 9, time9Field); + + jobject dateField = env->NewStringUTF(" 2019-03-02"); + env->SetObjectArrayElement(arr, 10, dateField); + + jobject int11Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 11, int11Field); + + jobject int12Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 12, int12Field); + + jobject int13Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 13, int13Field); + + writer.write(arr); + + env->DeleteLocalRef(stringField); + env->DeleteLocalRef(string2Field); + env->DeleteLocalRef(intField); + env->DeleteLocalRef(int4Field); + env->DeleteLocalRef(string5Field); + env->DeleteLocalRef(int6Field); + env->DeleteLocalRef(dateField); + env->DeleteLocalRef(timeField); + env->DeleteLocalRef(string7Field); + env->DeleteLocalRef(int8Field); + env->DeleteLocalRef(int11Field); + env->DeleteLocalRef(int12Field); + env->DeleteLocalRef(int13Field); + env->DeleteLocalRef(arr); + } + writer.close(); + + CarbonReader carbonReader; + carbonReader.builder(env, path); + carbonReader.build(); + int i = 0; + int printNum = 10; + CarbonRow carbonRow(env); + while (carbonReader.hasNext()) { + jobject row = carbonReader.readNextRow(); + i++; + carbonRow.setCarbonRow(row); + if (i < printNum) { + printf("%s\t%d\t%ld\t", carbonRow.getString(1)); + } + env->DeleteLocalRef(row); + } + carbonReader.close(); + } catch (jthrowable ex) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } Review comment: why not use `__finally` block to close the reader ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
jackylk 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_r363096899 ########## File path: store/CSDK/src/CarbonWriter.cpp ########## @@ -271,6 +285,22 @@ void CarbonWriter::withBlockletSize(int blockletSize) { } } +void CarbonWriter::withSchemaFile(char *schemaFilePath) { Review comment: Since this is interface exposed to user, please add comment to describe the function ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
jackylk 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_r363096907 ########## File path: store/CSDK/src/CarbonWriter.cpp ########## @@ -110,6 +110,20 @@ void CarbonWriter::withCsvInput(char *jsonSchema) { } }; +void CarbonWriter::withCsvInput() { Review comment: Since this is interface exposed to user, please add comment to describe the function ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
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: [hidden email] With regards, Apache Git Services |
In reply to this post by GitBox
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_r363102983 ########## File path: store/CSDK/src/CarbonWriter.cpp ########## @@ -271,6 +285,22 @@ void CarbonWriter::withBlockletSize(int blockletSize) { } } +void CarbonWriter::withSchemaFile(char *schemaFilePath) { Review comment: Already describe it in interface: ``` /** * To set the path of carbon schema file * @param schemaFilePath The path of carbon schema file */ void withSchemaFile(char *schemaFilePath); ``` ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-570933497 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1483/ ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
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_r363132723 ########## File path: store/CSDK/src/CarbonWriter.cpp ########## @@ -271,6 +285,22 @@ void CarbonWriter::withBlockletSize(int blockletSize) { } } +void CarbonWriter::withSchemaFile(char *schemaFilePath) { Review comment: also added in here ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
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_r363132727 ########## File path: store/CSDK/src/CarbonWriter.cpp ########## @@ -110,6 +110,20 @@ void CarbonWriter::withCsvInput(char *jsonSchema) { } }; +void CarbonWriter::withCsvInput() { Review comment: Already describe it in interface,also added in here ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
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_r365562824 ########## 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); + + + jobject intField = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 0, intField); + + jobject stringField = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 1, stringField); + + + jobject string2Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 2, string2Field); + + + jobject timeField = env->NewStringUTF("2019-02-12 03:03:34"); + env->SetObjectArrayElement(arr, 3, timeField); + + + jobject int4Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 4, int4Field); + + jobject string5Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 5, string5Field); + + jobject int6Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 6, int6Field); + + jobject string7Field = env->NewStringUTF(a); + env->SetObjectArrayElement(arr, 7, string7Field); + + jobject int8Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 8, int8Field); + + jobject time9Field = env->NewStringUTF("2019-02-12 03:03:34"); + env->SetObjectArrayElement(arr, 9, time9Field); + + jobject dateField = env->NewStringUTF(" 2019-03-02"); + env->SetObjectArrayElement(arr, 10, dateField); + + jobject int11Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 11, int11Field); + + jobject int12Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 12, int12Field); + + jobject int13Field = env->NewStringUTF(ctrInt); + env->SetObjectArrayElement(arr, 13, int13Field); + + writer.write(arr); + + env->DeleteLocalRef(stringField); + env->DeleteLocalRef(string2Field); + env->DeleteLocalRef(intField); + env->DeleteLocalRef(int4Field); + env->DeleteLocalRef(string5Field); + env->DeleteLocalRef(int6Field); + env->DeleteLocalRef(dateField); + env->DeleteLocalRef(timeField); + env->DeleteLocalRef(string7Field); + env->DeleteLocalRef(int8Field); + env->DeleteLocalRef(int11Field); + env->DeleteLocalRef(int12Field); + env->DeleteLocalRef(int13Field); + env->DeleteLocalRef(arr); + } + writer.close(); + + CarbonReader carbonReader; + carbonReader.builder(env, path); + carbonReader.build(); + int i = 0; + int printNum = 10; + CarbonRow carbonRow(env); + while (carbonReader.hasNext()) { + jobject row = carbonReader.readNextRow(); + i++; + carbonRow.setCarbonRow(row); + if (i < printNum) { + printf("%s\t%d\t%ld\t", carbonRow.getString(1)); + } + env->DeleteLocalRef(row); + } + carbonReader.close(); + } catch (jthrowable ex) { + env->ExceptionDescribe(); + env->ExceptionClear(); + } 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] With regards, Apache Git Services |
In reply to this post by GitBox
xubo245 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-573389824 @jackylk @zzcclp optimized the comments. Please review it again. ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-573394550 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1609/ ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
jackylk commented on issue #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526#issuecomment-574542665 LGTM ---------------------------------------------------------------- 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 |
In reply to this post by GitBox
asfgit closed pull request #3526: [CARBONDATA-3627] C++ SDK support write data withSchemaFile
URL: https://github.com/apache/carbondata/pull/3526 ---------------------------------------------------------------- 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 |
Free forum by Nabble | Edit this page |