Package org.apache.hadoop.hive.serde2.io

Examples of org.apache.hadoop.hive.serde2.io.DateWritable.readFields()


      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
    case DataType.DATE:
      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
    case DataType.TIMESTAMP:
      TimestampWritable tw = new TimestampWritable();
      tw.readFields(in);
      return tw.getTimestamp();
View Full Code Here


    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    bais = new ByteArrayInputStream(valueBytes);
    in = new DataInputStream(bais);
    dateWritable.readFields(in);

    Assert.assertEquals(dateValue, dateWritable.get());

    // timestamp
    cqHolder.set("timestamp");
View Full Code Here

        list.add(readDatum(in));
      }
      return list;
    case DataType.CHAR:
      HiveCharWritable hcw = new HiveCharWritable();
      hcw.readFields(in);
      return hcw.getHiveChar();
    case DataType.VARCHAR:
      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
View Full Code Here

      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
    case DataType.DECIMAL:
      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
    case DataType.DATE:
      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
View Full Code Here

    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    ByteArrayInputStream bais = new ByteArrayInputStream(valueBytes);
    DataInputStream in = new DataInputStream(bais);
    decimalWritable.readFields(in);

    Assert.assertEquals(decimalValue, decimalWritable.getHiveDecimal());

    // date
    cqHolder.set("date");
View Full Code Here

      HiveCharWritable hcw = new HiveCharWritable();
      hcw.readFields(in);
      return hcw.getHiveChar();
    case DataType.VARCHAR:
      HiveVarcharWritable hvw = new HiveVarcharWritable();
      hvw.readFields(in);
      return hvw.getHiveVarchar();
    case DataType.DECIMAL:
      HiveDecimalWritable hdw = new HiveDecimalWritable();
      hdw.readFields(in);
      return hdw.getHiveDecimal();
View Full Code Here

      DateWritable dw = new DateWritable();
      dw.readFields(in);
      return dw.get();
    case DataType.TIMESTAMP:
      TimestampWritable tw = new TimestampWritable();
      tw.readFields(in);
      return tw.getTimestamp();
    default:
      throw new IOException("Unexpected data type " + type +
        " found in stream.");
    }
View Full Code Here

    Assert.assertNotNull(valueBytes);

    byteRef.setData(valueBytes);
    bais = new ByteArrayInputStream(valueBytes);
    in = new DataInputStream(bais);
    timestampWritable.readFields(in);

    Assert.assertEquals(timestampValue, timestampWritable.getTimestamp());

    // char
    cqHolder.set("char");
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.