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

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


      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


      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

   */
  private void write(Schema destinationSchema, ITuple tuple,
      int[] translationTable, DataOutput output) 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

    }
    schemas.add(schema);
  }

  private boolean fieldSameTypeInAllSources(String field) {
    Type type = null;
    for(Schema source : schemas) {
      Field f = source.getField(field);
      if (f == null){
        Map<String,String> aliases = fieldAliases.get(source.getName());
        f = source.getField(aliases.get(field));
View Full Code Here

   */
  private void write(Schema destinationSchema, ITuple tuple,
      int[] translationTable, DataOutput output,Serializer[] 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

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.