Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2807#discussion_r228570889
  
    --- Diff: store/CSDK/main.cpp ---
    @@ -168,9 +220,51 @@ bool readFromS3(JNIEnv *env, char *argv[]) {
             printf("\n");
         }
     
    +    printf("\nread Schema from Index File from S3:\n");
    +    CarbonSchemaReader carbonSchemaReader(env);
    +    jobject schema = carbonSchemaReader.readSchemaInIndexFile(
    +            
"s3a://sdk/WriterOutput/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("%s\n", carbonSchema.getArrayElementTypeName(i));
    +        }
    +    }
    +
         reader.close();
     }
     
    +/**
    + * test read Schema from Index File from S3
    + * TODO: need support in the future
    + *
    + * @param env jni env
    + * @return whether it is success
    + */
    +bool readSchemaInIndexFileFromS3(JNIEnv *env) {
    --- End diff --
    
    I will test and support it before merge


---

Reply via email to