Package com.datasalt.pangool.io.Schema.Field

Examples of com.datasalt.pangool.io.Schema.Field.Type


   */
  private void write(Schema destinationSchema, ITuple tuple,
      int[] translationTable, DataOutput output,FieldSerializer[] customSerializers) throws IOException {
    for (int i = 0; i < destinationSchema.getFields().size(); i++) {
      Field field = destinationSchema.getField(i);
      Type fieldType = field.getType();
      Object element = tuple.get(translationTable[i]);
      try {
        switch(fieldType){
        case INT:
          WritableUtils.writeVInt(output, (Integer) element); break;
View Full Code Here


      if(nameType.length != 2) {
        throw new RuntimeException("Incorrect fields description " + serialized);
      }
      String fieldName = nameType[0].trim();
      String fieldType = nameType[1].trim();
      Type type = strToType.get(fieldType);
      try {
        if(type != null) {
          fields.add(Field.create(fieldName, type));
        } else {
          Class<?> objectClazz = Class.forName(fieldType);
View Full Code Here

  public void write(Schema destinationSchema, ITuple tuple, int[] translationTable, Serializer[] customSerializers)
      throws IOException {
    for(int i = 0; i < destinationSchema.getFields().size(); i++) {
      Field field = destinationSchema.getField(i);
      Type fieldType = field.getType();
      Object element;
      if(translationTable == null) {
        element = tuple.get(i);
      } else {
        element = tuple.get(translationTable[i]);
View Full Code Here

    }
    schemas.add(schema);
  }

  private boolean fieldSameTypeInAllSources(String field) {
    Type type = null;
    for(Schema source : schemas) {
      Field f = source.getField(field);
      if(type == null) {
        type = f.getType();
      } else if(type != f.getType()) {
View Full Code Here

      if(nameType.length != 2) {
        throw new TupleMRException("Incorrect fields description " + serialized);
      }
      String fieldName = nameType[0].trim();
      String fieldType = nameType[1].trim();
      Type type = strToType.get(fieldType);
      try {
        if(type != null) {
          fields.add(Field.create(fieldName, type));
        } else {
          Class<?> objectClazz = Class.forName(fieldType);
View Full Code Here

    }
    schemas.add(schema);
  }

  private boolean fieldSameTypeInAllSources(String field) {
    Type type = null;
    for(Schema source : schemas) {
      Field f = source.getField(field);
      if(type == null) {
        type = f.getType();
      } else if(type != f.getType()) {
View Full Code Here

      }
      if (already.contains(fieldName)) {
        throw new IllegalArgumentException("Duplicated field name [" + fieldName + "] in description [" + serialized + "]");
      }
      already.add(fieldName);
      Type type = strToType.get(fieldType);
      try {
        if (type != null) {
          fields.add(Field.create(fieldName, type, nullable));
        } else {
          Class<?> objectClazz = Class.forName(fieldType);
View Full Code Here

      nulls.ser(out);
    }

    for (int i = 0; i < destinationSchema.getFields().size(); i++) {
      Field field = destinationSchema.getField(i);
      Type fieldType = field.getType();
      Object element = valueAt(i, tuple, translationTable);
      if (element == null) {
        if (field.isNullable()) {
          // Nullable null fields don't need serialization.
          continue;
View Full Code Here

      String fieldType = nameType[1].trim();
      if (already.contains(fieldName)) {
        throw new IllegalArgumentException("Duplicated field name [" + fieldName + "] in description [" + serialized +"]");
      }
      already.add(fieldName);
      Type type = strToType.get(fieldType);
      try {
        if(type != null) {
          fields.add(Field.create(fieldName, type));
        } else {
          Class<?> objectClazz = Class.forName(fieldType);
View Full Code Here

  void write(Schema destinationSchema, ITuple tuple, int[] translationTable, Serializer[] customSerializers)
      throws IOException {
    for(int i = 0; i < destinationSchema.getFields().size(); i++) {
      Field field = destinationSchema.getField(i);
      Type fieldType = field.getType();
      Object element;
      if(translationTable == null) {
        element = tuple.get(i);
      } else {
        element = tuple.get(translationTable[i]);
View Full Code Here

TOP

Related Classes of com.datasalt.pangool.io.Schema.Field.Type

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.