Github user xubo245 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2807#discussion_r228570298
--- Diff: store/CSDK/main.cpp ---
@@ -55,6 +57,56 @@ JNIEnv *initJVM() {
return env;
}
+/**
+ * test read Schema from Index File
+ *
+ * @param env jni env
+ * @return whether it is success
+ */
+bool readSchemaInIndexFile(JNIEnv *env) {
+ printf("\nread Schema from Index File:\n");
+ CarbonSchemaReader carbonSchemaReader(env);
+ jobject schema = carbonSchemaReader.readSchemaInIndexFile(
+
"../resources/carbondata/510199997055746_batchno0-0-null-510199277323454.carbonindex");
+ Schema carbonSchema(env, schema);
+ int length = carbonSchema.getFieldsLength();
+ printf("schema length is:%d\n", length);
+ for (int i = 0; i < length; i++) {
+ printf("%d\t", i);
+ printf("%s\t", carbonSchema.getFieldName(i));
+ printf("%s\n", carbonSchema.getFieldDataTypeName(i));
+ if (strcmp(carbonSchema.getFieldDataTypeName(i), "ARRAY") == 0) {
+ printf("Array Element Type Name is:%s\n",
carbonSchema.getArrayElementTypeName(i));
+ }
+ }
+ return true;
+}
+
+/**
+ * test read Schema from Data File
+ *
+ * @param env jni env
+ * @return whether it is success
+ */
+bool readSchemaInDataFile(JNIEnv *env) {
+ printf("\nread Schema from Data File:\n");
+ CarbonSchemaReader carbonSchemaReader(env);
+ jobject schema = carbonSchemaReader.readSchemaInDataFile(
--- End diff --
no binaries files in repo, only in my local
---