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

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


    @Override
    void write(Object obj) throws IOException {
      super.write(obj);
      if (obj != null) {
        // Using the Writable here as it's used directly for writing as well as for stats.
        DateWritable val = ((DateObjectInspector) inspector).getPrimitiveWritableObject(obj);
        indexStatistics.updateDate(val);
        writer.write(val.getDays());
      }
    }
View Full Code Here


        BytesWritable bw2 = ((BinaryObjectInspector) poi2).getPrimitiveWritableObject(o2);
        return bw1.compareTo(bw2);
      }

      case DATE: {
        DateWritable d1 = ((DateObjectInspector) poi1)
            .getPrimitiveWritableObject(o1);
        DateWritable d2 = ((DateObjectInspector) poi2)
            .getPrimitiveWritableObject(o2);
        return d1.compareTo(d2);
      }
      case TIMESTAMP: {
        TimestampWritable t1 = ((TimestampObjectInspector) poi1)
View Full Code Here

        byteStream.write(bw.getBytes(),0,length);
        return warnedOnceNullMapKey;
      }

      case DATE: {
        DateWritable d = ((DateObjectInspector) poi).getPrimitiveWritableObject(obj);
        d.writeToByteStream(byteStream);
        return warnedOnceNullMapKey;
      }
      case TIMESTAMP: {
        TimestampObjectInspector toi = (TimestampObjectInspector) poi;
        TimestampWritable t = toi.getPrimitiveWritableObject(obj);
View Full Code Here

    LazyBinaryPrimitive<WritableDateObjectInspector, DateWritable> {
  static final Log LOG = LogFactory.getLog(LazyBinaryDate.class);

  LazyBinaryDate(WritableDateObjectInspector oi) {
    super(oi);
    data = new DateWritable();
  }
View Full Code Here

    data = new DateWritable();
  }

  LazyBinaryDate(LazyBinaryDate copy) {
    super(copy);
    data = new DateWritable(copy.data);
  }
View Full Code Here

    DateStatisticsImpl(OrcProto.ColumnStatistics stats) {
      super(stats);
      OrcProto.DateStatistics dateStats = stats.getDateStatistics();
      // min,max values serialized/deserialized as int (days since epoch)
      if (dateStats.hasMaximum()) {
        maximum = new DateWritable(dateStats.getMaximum());
      }
      if (dateStats.hasMinimum()) {
        minimum = new DateWritable(dateStats.getMinimum());
      }
    }
View Full Code Here

    @Override
    void write(Object obj) throws IOException {
      super.write(obj);
      if (obj != null) {
        // Using the Writable here as it's used directly for writing as well as for stats.
        DateWritable val = ((DateObjectInspector) inspector).getPrimitiveWritableObject(obj);
        indexStatistics.updateDate(val);
        writer.write(val.getDays());
      }
    }
View Full Code Here

        BytesWritable bw2 = ((BinaryObjectInspector) poi2).getPrimitiveWritableObject(o2);
        return bw1.compareTo(bw2);
      }

      case DATE: {
        DateWritable d1 = ((DateObjectInspector) poi1)
            .getPrimitiveWritableObject(o1);
        DateWritable d2 = ((DateObjectInspector) poi2)
            .getPrimitiveWritableObject(o2);
        return d1.compareTo(d2);
      }
      case TIMESTAMP: {
        TimestampWritable t1 = ((TimestampObjectInspector) poi1)
View Full Code Here

  public Date getPrimitiveJavaObject(Object o) {
    return o == null ? null : ((DateWritable) o).get();
  }

  public Object copyObject(Object o) {
    return o == null ? null : new DateWritable((DateWritable) o);
  }
View Full Code Here

    ((DateWritable) o).set(d);
    return o;
  }

  public Object create(Date d) {
    return new DateWritable(d);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.io.DateWritable

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.