Package com.facebook.hive.orc.lazy

Examples of com.facebook.hive.orc.lazy.OrcLazyObject$ValueNotPresentException


    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here


    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

    lazyRow = (OrcLazyStruct) rows.next(lazyRow);
    row = (OrcStruct) lazyRow.materialize();

    // Check that the object read equals what is expected, then copy the object, and make the same
    // check
    OrcLazyObject obj;
    assertEquals(false,
        ((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());

    assertEquals(1, ((IntWritable) ((OrcLazyInt) row.getFieldValue(3)).materialize()).get());
    obj = new OrcLazyInt((OrcLazyInt) row.getFieldValue(3));
    assertEquals(1, ((IntWritable) obj.materialize()).get());

    assertEquals(1, ((LongWritable) ((OrcLazyLong) row.getFieldValue(4)).materialize()).get());
    obj = new OrcLazyLong((OrcLazyLong) row.getFieldValue(4));
    assertEquals(1, ((LongWritable) obj.materialize()).get());

    assertEquals(1.0f,
        ((FloatWritable) ((OrcLazyFloat) row.getFieldValue(5)).materialize()).get());
    obj = new OrcLazyFloat((OrcLazyFloat) row.getFieldValue(5));
    assertEquals(1.0f, ((FloatWritable) obj.materialize()).get());

    assertEquals(1.0,
        ((DoubleWritable) ((OrcLazyDouble) row.getFieldValue(6)).materialize()).get());
    obj = new OrcLazyDouble((OrcLazyDouble) row.getFieldValue(6));
    assertEquals(1.0, ((DoubleWritable) obj.materialize()).get());

    assertEquals(bytes(1), ((OrcLazyBinary) row.getFieldValue(7)).materialize());
    obj = new OrcLazyBinary((OrcLazyBinary) row.getFieldValue(7));
    assertEquals(bytes(1), obj.materialize());

    assertEquals("1", ((Text) ((OrcLazyString) row.getFieldValue(8)).materialize()).toString());
    obj = new OrcLazyString((OrcLazyString) row.getFieldValue(8));
    assertEquals("1", ((Text) obj.materialize()).toString());

    // Currently copies are not supported for complex types
  }
View Full Code Here

        checkArgument(!isPartitionColumn[column], "Column is a partition key");

        loaded[column] = true;
        nulls[column] = false;

        OrcLazyObject lazyObject = getRawValue(column);
        if (lazyObject == null) {
            nulls[column] = true;
            return;
        }
View Full Code Here

        return this.value.getFieldValue(hiveColumnIndexes[column]);
    }

    private Object getMaterializedValue(int column)
    {
        OrcLazyObject value = getRawValue(column);
        return (value == null) ? null : materializeValue(value);
    }
View Full Code Here

TOP

Related Classes of com.facebook.hive.orc.lazy.OrcLazyObject$ValueNotPresentException

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.