Package org.apache.hadoop.hive.serde2.avro

Examples of org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector


      this.conf = conf;
      this.stripeSize = stripeSize;
      this.compress = CompressionKind.valueOf(compress);
      this.compressionSize = compressionSize;
      this.rowIndexStride = rowIndexStride;
      this.stats = new SerDeStats();
    }
View Full Code Here


    // Check for a nested message. If found, set the schema, else return.
    if (!(oi instanceof AvroLazyObjectInspector)) {
      return;
    }

    AvroLazyObjectInspector aoi = (AvroLazyObjectInspector) oi;

    aoi.setSchemaRetriever(avroSchemaRetriever);
    aoi.setReaderSchema(schema);

    // call the method recursively over all the internal fields of the given avro
    // objectinspector
    for (StructField field : aoi.getAllStructFieldRefs()) {
      initAvroObjectInspector(field.getFieldObjectInspector());
    }
  }
View Full Code Here

                structFieldComments, separator, nullSequence, lastColumnTakesRest, escaped,
                escapeChar);
        break;
      case AVRO:
        result =
            new AvroLazyObjectInspector(structFieldNames, structFieldObjectInspectors,
                structFieldComments, separator, nullSequence, lastColumnTakesRest, escaped,
                escapeChar);
        break;
      default:
        throw new IllegalArgumentException("Illegal ObjectInspector type [" + option + "]");
View Full Code Here

    return reader.loadIndeces(rowIndexEntries, updatedStartIndex);
  }

  @Override
  public Object next(Object previous) throws IOException {
    ByteWritable result = null;
    if (valuePresent) {
      if (previous == null) {
        result = new ByteWritable();
      } else {
        result = (ByteWritable) previous;
      }
      result.set(reader.next());
    }
    return result;
  }
View Full Code Here

    return o == null ? null : new OrcLazyByte((OrcLazyByte) o);
  }

  @Override
  public Object getPrimitiveJavaObject(Object o) {
    ByteWritable writable = getPrimitiveWritableObject(o);
    return writable == null ? null : Byte.valueOf(writable.get());
  }
View Full Code Here

  }

  public OrcLazyByte(OrcLazyByte copy) {
    super(copy);
    if (copy.previous != null) {
      previous = new ByteWritable(((ByteWritable)copy.previous).get());
    }
  }
View Full Code Here

      int nextCalls = 0;

      @Override
      public Object next(Object previous) throws IOException {
        if (nextCalls == 0) {
          return new ByteWritable((byte) 1);
        }

        throw new IOException("next should only be called once");
      }
View Full Code Here

      assertNull(expected.boolean1);
    } else {
      assertEquals(expected.boolean1.booleanValue(), boolean1.get());
    }

    ByteWritable byte1 = (ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize();
    if (byte1 == null) {
      assertNull(expected.byte1);
    } else {
      assertEquals(expected.byte1.byteValue(), byte1.get());
    }

    OrcLazyShort lazyShort1 = (OrcLazyShort) row.getFieldValue(2);
    ShortWritable short1 = (ShortWritable) lazyShort1.materialize();
    if (short1 == null) {
View Full Code Here

    return latestRead;
  }


  DoubleWritable createWritable(Object previous, double v) throws IOException {
    DoubleWritable result = null;
    if (previous == null) {
      result = new DoubleWritable();
    } else {
      result = (DoubleWritable) previous;
    }
    result.set(v);
    return result;
  }
View Full Code Here

  /**
   * Give the next double as a Writable object.
   */
  @Override
  public Object next(Object previous) throws IOException {
    DoubleWritable result = null;
    if (valuePresent) {
      result = createWritable(previous, readDouble());
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.avro.AvroLazyObjectInspector

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.