Examples of ByteWritable


Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    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

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    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

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

  }

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

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

      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

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

      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

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    public Object getPrimitiveWritableObject(Object o) {
        ByteOption object = (ByteOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        return new ByteWritable(object.get());
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
    p.add(cfb, qualBool, Bytes.toBytes("true"));

    Object[] expectedFieldsData = {
      new Text("test-row1"),
      new ByteWritable((byte)123),
      new ShortWritable((short)456),
      new IntWritable(789),
      new LongWritable(1000),
      new FloatWritable(-0.01F),
      new DoubleWritable(5.3),
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

      bytes.set(i, cu);
    }
    writer.append(bytes);
    writer.close();

    Object[] expectedRecord_1 = {new ByteWritable((byte) 123),
        new ShortWritable((short) 456), new IntWritable(789),
        new LongWritable(1000), new DoubleWritable(5.3),
        new Text("hive and hadoop"), null, null};

    Object[] expectedRecord_2 = {new ByteWritable((byte) 100),
        new ShortWritable((short) 200), new IntWritable(123),
        new LongWritable(1000), new DoubleWritable(5.3),
        new Text("hive and hadoop"), null, null};

    RCFile.Reader reader = new RCFile.Reader(fs, file, conf);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

      bytes.set(i, cu);
    }

    // zero length key is not allowed by block compress writer, so we use a byte
    // writable
    ByteWritable key = new ByteWritable();
    SequenceFile.Writer seqWriter = SequenceFile.createWriter(fs, conf, file,
        ByteWritable.class, BytesRefArrayWritable.class, CompressionType.BLOCK,
        codec);

    for (int i = 0; i < rowCount; i++) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.io.ByteWritable

    return fs.getUri().toString().startsWith("file://");
  }

  public void performSequenceFileRead(FileSystem fs, int count, Path file) throws IOException {
    SequenceFile.Reader reader = new SequenceFile.Reader(fs, file, conf);
    ByteWritable key = new ByteWritable();
    BytesRefArrayWritable val = new BytesRefArrayWritable();
    for (int i = 0; i < count; i++) {
      reader.next(key, val);
    }
  }
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.