Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-1620

Schema creation from another schema will not be possible - deprecated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.0
    • None
    • parquet-mr

    Description

      Imagine I have a current schema and want to create a projection schema from that. One option is the schema.Types.*Builder but the more direct version would be to clone the schema itself without children.

      List<org.apache.parquet.schema.Type> l = new ArrayList<>();
      {{ for (String c : childmappings.keySet()) {}}
        Mapping m = childmappings.get(c);
        l.add(m.getProjectionSchema());
      {{ }}}
      {{ GroupType gt = new GroupType(schema.getRepetition(), schema.getName(), schema.getOriginalType(), l);}}

       

      The last line, the new GroupType(..) constructor is deprecated. We should use the version with the LogicalTypeAnnotation instead. Fine. But how do you get the LogicalTypeAnnotation  from an existing schema?

      I feel you should not deprecate these methods and if, provide an extra method to create a Type column from a type column (column alone, without children. Else the projection would have all child columns).

       

      Do you agree?

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wdaehn Werner Daehn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: