Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-2982

CarbonSchemaReader don't support Array<string>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.5.0
    • other
    • None

    Description

      CarbonSchemaReader don't support Array<string>
      When we read schema from index file and the data include array<string> data type

      run org.apache.carbondata.examples.sdk.CarbonReaderExample :

          Schema schema = CarbonSchemaReader
                      .readSchemaInIndexFile(dataFiles[0].getAbsolutePath())
                      .asOriginOrder();
                  // Transform the schema
                  String[] strings = new String[schema.getFields().length];
                  for (int i = 0; i < schema.getFields().length; i++) {
                      strings[i] = (schema.getFields())[i].getFieldName();
                      System.out.println(strings[i] + "\t" + schema.getFields()[i].getSchemaOrdinal());
                  }
      

      and throw some exception:

      log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
      arrayfield.val0	-1
      stringfield	0
      shortfield	1
      intfield	2
      longfield	3
      doublefield	4
      boolfield	5
      datefield	6
      timefield	7
      decimalfield	8
      varcharfield	9
      arrayfield	10
      Complex child columns projection NOT supported through CarbonReader
      java.lang.UnsupportedOperationException: Complex child columns projection NOT supported through CarbonReader
      	at org.apache.carbondata.sdk.file.CarbonReaderBuilder.build(CarbonReaderBuilder.java:155)
      	at org.apache.carbondata.examples.sdk.CarbonReaderExample.main(CarbonReaderExample.java:110)
      

      It print arrayfield.val0 -1, child schema

      Attachments

        Issue Links

          Activity

            People

              xubo245 Bo Xu
              xubo245 Bo Xu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 20m
                  4h 20m