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

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


    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();
    default:
      throw new IOException("Unexpected data type " + type +
        " found in stream.");
    }
  }
View Full Code Here


      return;
    case DataType.DATE:
      new DateWritable((Date)val).write(out);
      return;
    case DataType.TIMESTAMP:
      new TimestampWritable((java.sql.Timestamp)val).write(out);
      return;
    default:
      throw new IOException("Unexpected data type " + type +
        " found in stream.");
    }
View Full Code Here

public class LazyTimestamp extends LazyPrimitive<LazyTimestampObjectInspector, TimestampWritable> {
  static final private Log LOG = LogFactory.getLog(LazyTimestamp.class);

  public LazyTimestamp(LazyTimestampObjectInspector oi) {
    super(oi);
    data = new TimestampWritable();
  }
View Full Code Here

    data = new TimestampWritable();
  }

  public LazyTimestamp(LazyTimestamp copy) {
    super(copy);
    data = new TimestampWritable(copy.data);
  }
View Full Code Here

  protected JavaTimestampObjectInspector() {
    super(TypeInfoFactory.timestampTypeInfo);
  }

  public TimestampWritable getPrimitiveWritableObject(Object o) {
    return o == null ? null : new TimestampWritable((Timestamp) o);
  }
View Full Code Here

        return ((BinaryObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();

      case DATE:
        return ((DateObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();
      case TIMESTAMP:
        TimestampWritable t = ((TimestampObjectInspector) poi)
            .getPrimitiveWritableObject(o);
        return t.hashCode();
      case DECIMAL:
        return ((HiveDecimalObjectInspector) poi).getPrimitiveWritableObject(o).hashCode();

      default: {
        throw new RuntimeException("Unknown type: "
View Full Code Here

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

  public Timestamp getPrimitiveJavaObject(Object o) {
    return o == null ? null : ((TimestampWritable) o).getTimestamp();
  }

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

    ((TimestampWritable) o).set(t);
    return o;
  }

  public Object create(byte[] bytes, int offset) {
    return new TimestampWritable(bytes, offset);
  }
View Full Code Here

  public Object create(byte[] bytes, int offset) {
    return new TimestampWritable(bytes, offset);
  }

  public Object create(Timestamp t) {
    return new TimestampWritable(t);
  }
View Full Code Here

TOP

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

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.