Package org.apache.crunch.lib.Sort

Examples of org.apache.crunch.lib.Sort.ColumnOrder.order()


      AvroType<?> atype = (AvroType<?>) ptype.getSubTypes().get(index);
      Schema fieldSchema = atype.getSchema();
      String fieldName = parentAvroSchema.getFields().get(index).name();
      // Note: avro sorting of strings is inverted relative to how sorting works for WritableComparable
      // Text instances: making this consistent
      Schema.Field.Order order = columnOrder.order() == Order.DESCENDING ? Schema.Field.Order.DESCENDING :
        Schema.Field.Order.ASCENDING;
      fields.add(new Schema.Field(fieldName, fieldSchema, "", null, order));
    }
    schema.setFields(fields);
    return schema;
View Full Code Here


      AvroType<?> atype = (AvroType<?>) ptype.getSubTypes().get(index);
      Schema fieldSchema = atype.getSchema();
      String fieldName = parentAvroSchema.getFields().get(index).name();
      // Note: avro sorting of strings is inverted relative to how sorting works for WritableComparable
      // Text instances: making this consistent
      Schema.Field.Order order = columnOrder.order() == Order.DESCENDING ? Schema.Field.Order.DESCENDING :
        Schema.Field.Order.ASCENDING;
      fields.add(new Schema.Field(fieldName, fieldSchema, "", null, order));
    }
    schema.setFields(fields);
    return schema;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.