Examples of OrcLazyByte


Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

   * @throws Exception
   */
  @Test
  public void TestCopyByte() throws Exception {
    ReaderWriterProfiler.setProfilerOptions(null);
    OrcLazyByte lazyByte = new OrcLazyByte(new LazyByteTreeReader(0, 0) {
      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");
      }

      @Override
      protected boolean seekToRow(long currentRow) throws IOException {
        return true;
      }
    });

    ByteObjectInspector byteOI = (ByteObjectInspector)
        OrcLazyObjectInspectorUtils.createLazyObjectInspector(TypeInfoFactory.byteTypeInfo);

    OrcLazyByte lazyByte2 = (OrcLazyByte) byteOI.copyObject(lazyByte);

    Assert.assertEquals(1, ((ByteWritable) lazyByte.materialize()).get());
    Assert.assertEquals(1, ((ByteWritable) lazyByte2.materialize()).get());
  }
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

    OrcProto.Type type = types.get(columnId);
    switch (type.getKind()) {
      case BOOLEAN:
        return new OrcLazyBoolean((LazyBooleanTreeReader)createLazyTreeReader(columnId, types, included));
      case BYTE:
        return new OrcLazyByte((LazyByteTreeReader)createLazyTreeReader(columnId, types, included));
      case DOUBLE:
        return new OrcLazyDouble((LazyDoubleTreeReader)createLazyTreeReader(columnId, types, included));
      case FLOAT:
        return new OrcLazyFloat((LazyFloatTreeReader)createLazyTreeReader(columnId, types, included));
      case SHORT:
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

   * @throws Exception
   */
  @Test
  public void TestCopyByte() throws Exception {
    ReaderWriterProfiler.setProfilerOptions(null);
    OrcLazyByte lazyByte = new OrcLazyByte(new LazyByteTreeReader(0, 0) {
      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");
      }

      @Override
      protected boolean seekToRow(long currentRow) throws IOException {
        return true;
      }
    });

    ByteObjectInspector byteOI = (ByteObjectInspector)
        OrcLazyObjectInspectorUtils.createLazyObjectInspector(TypeInfoFactory.byteTypeInfo);

    OrcLazyByte lazyByte2 = (OrcLazyByte) byteOI.copyObject(lazyByte);

    Assert.assertEquals(1, ((ByteWritable) lazyByte.materialize()).get());
    Assert.assertEquals(1, ((ByteWritable) lazyByte2.materialize()).get());
  }
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

    OrcProto.Type type = types.get(columnId);
    switch (type.getKind()) {
      case BOOLEAN:
        return new OrcLazyBoolean((LazyBooleanTreeReader)createLazyTreeReader(columnId, types, included));
      case BYTE:
        return new OrcLazyByte((LazyByteTreeReader)createLazyTreeReader(columnId, types, included));
      case DOUBLE:
        return new OrcLazyDouble((LazyDoubleTreeReader)createLazyTreeReader(columnId, types, included));
      case FLOAT:
        return new OrcLazyFloat((LazyFloatTreeReader)createLazyTreeReader(columnId, types, included));
      case SHORT:
View Full Code Here

Examples of com.facebook.hive.orc.lazy.OrcLazyByte

        ((BooleanWritable) ((OrcLazyBoolean) row.getFieldValue(0)).materialize()).get());
    obj = new OrcLazyBoolean((OrcLazyBoolean) row.getFieldValue(0));
    assertEquals(false, ((BooleanWritable) obj.materialize()).get());

    assertEquals(1, ((ByteWritable) ((OrcLazyByte) row.getFieldValue(1)).materialize()).get());
    obj = new OrcLazyByte((OrcLazyByte) row.getFieldValue(1));
    assertEquals(1, ((ByteWritable) obj.materialize()).get());

    assertEquals(1, ((ShortWritable) ((OrcLazyShort) row.getFieldValue(2)).materialize()).get());
    obj = new OrcLazyShort((OrcLazyShort) row.getFieldValue(2));
    assertEquals(1, ((ShortWritable) obj.materialize()).get());
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.