Package org.apache.trevni

Examples of org.apache.trevni.ColumnMetaData


   
    switch (s.getType()) {
    case MAP:
      path = path == null ? ">" : path+">";
      int start = columns.size();
      ColumnMetaData p = addColumn(path, ValueType.NULL, parent, true);
      addColumn(p(path,"key", ""), ValueType.STRING, p, false);
      columnize(p(path,"value", ""), s.getValueType(), p, false);
      arrayWidths.set(start, columns.size()-start); // fixup with actual width
      break;
    case RECORD:
View Full Code Here


    return parent == null ? child : parent + sep + child;
  }

  private ColumnMetaData addColumn(String path, ValueType type,
                                   ColumnMetaData parent, boolean isArray) {
    ColumnMetaData column = new ColumnMetaData(path, type);
    if (parent != null)
      column.setParent(parent);
    column.isArray(isArray);
    columns.add(column);
    arrayWidths.add(1);                           // placeholder
    return column;
}
View Full Code Here

      addColumn(path, simpleValueType(element), parent, true);
      return;
    }
    // complex array: insert a parent column with lengths
    int start = columns.size();
    ColumnMetaData array = addColumn(path, ValueType.NULL, parent, true);
    columnize(path, element, array, false);
    arrayWidths.set(start, columns.size()-start); // fixup with actual width
  }
View Full Code Here

    ColumnMetaData [] trevniMetas =
        new ColumnMetaData[schema.size()];
    int i = 0;
    for (Column column : schema.getColumns()) {
      trevniMetas[i++] = new ColumnMetaData(column.getSimpleName(),
          getType(column.getDataType().getType()));
    }

    writer = new ColumnFileWriter(createFileMeta(), trevniMetas);
View Full Code Here

  }

  // trim off portion of name shared with parent
  private String shortName(ColumnMetaData column) {
    String name = column.getName();
    ColumnMetaData parent = column.getParent();
    if (parent != null && name.startsWith(parent.getName()))
      name = name.substring(parent.getName().length());
    if (!Character.isLetterOrDigit(name.charAt(0)))
      name = name.substring(1);
    return name;
  }
View Full Code Here

  }

  // trim off portion of name shared with parent
  private String shortName(ColumnMetaData column) {
    String name = column.getName();
    ColumnMetaData parent = column.getParent();
    if (parent != null && name.startsWith(parent.getName()))
      name = name.substring(parent.getName().length());
    if (!Character.isLetterOrDigit(name.charAt(0)))
      name = name.substring(1);
    return name;
  }
View Full Code Here

   
    switch (s.getType()) {
    case MAP:
      path = path == null ? ">" : path+">";
      int start = columns.size();
      ColumnMetaData p = addColumn(path, ValueType.NULL, parent, true);
      addColumn(p(path,"key", ""), ValueType.STRING, p, false);
      columnize(p(path,"value", ""), s.getValueType(), p, false);
      arrayWidths.set(start, columns.size()-start); // fixup with actual width
      break;
    case RECORD:
View Full Code Here

    return parent == null ? child : parent + sep + child;
  }

  private ColumnMetaData addColumn(String path, ValueType type,
                                   ColumnMetaData parent, boolean isArray) {
    ColumnMetaData column = new ColumnMetaData(path, type);
    if (parent != null)
      column.setParent(parent);
    column.isArray(isArray);
    columns.add(column);
    arrayWidths.add(1);                           // placeholder
    return column;
}
View Full Code Here

      addColumn(path, simpleValueType(element), parent, true);
      return;
    }
    // complex array: insert a parent column with lengths
    int start = columns.size();
    ColumnMetaData array = addColumn(path, ValueType.NULL, parent, true);
    columnize(path, element, array, false);
    arrayWidths.set(start, columns.size()-start); // fixup with actual width
  }
View Full Code Here

  }

  // trim off portion of name shared with parent
  private String shortName(ColumnMetaData column) {
    String name = column.getName();
    ColumnMetaData parent = column.getParent();
    if (parent != null && name.startsWith(parent.getName()))
      name = name.substring(parent.getName().length());
    if (!Character.isLetterOrDigit(name.charAt(0)))
      name = name.substring(1);
    return name;
  }
View Full Code Here

TOP

Related Classes of org.apache.trevni.ColumnMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.