Package org.apache.hadoop.hive.serde2.lazy

Examples of org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe


  private short latestValue() {
    return latestValue;
  }

  ShortWritable createWritable(Object previous, short v) throws IOException {
    ShortWritable result = null;
    if (previous == null) {
      result = new ShortWritable();
    } else {
      result = (ShortWritable) previous;
    }
    result.set(v);
    return result;
  }
View Full Code Here


    return readShort();
  }

  @Override
  public Object next(Object previous) throws IOException {
    ShortWritable result = null;
    if (valuePresent) {
      result = createWritable(previous, readShort());
    }
    return result;
  }
View Full Code Here

    return o == null ? null : new OrcLazyShort((OrcLazyShort) o);
  }

  @Override
  public Object getPrimitiveJavaObject(Object o) {
    ShortWritable writable = getPrimitiveWritableObject(o);
    return writable == null ? null : Short.valueOf(writable.get());
  }
View Full Code Here

      int getCalls = 0;

      @Override
      public Object get(long currentRow, Object previous) throws IOException {
        if (getCalls == 0) {
          return new ShortWritable((short) 1);
        }

        throw new IOException("get should only be called once");
      }
View Full Code Here

  }

  public OrcLazyTimestamp(OrcLazyTimestamp copy) {
    super(copy);
    if (copy.previous != null) {
      previous = new TimestampWritable(((TimestampWritable)copy.previous));
    }
  }
View Full Code Here

    super(PrimitiveObjectInspectorUtils.timestampTypeEntry);
  }

  @Override
  public Timestamp getPrimitiveJavaObject(Object o) {
    TimestampWritable writable = getPrimitiveWritableObject(o);
    return writable == null ? null : writable.getTimestamp();
  }
View Full Code Here

      int nextCalls = 0;

      @Override
      public Object next(Object previous) throws IOException {
        if (nextCalls == 0) {
          return new TimestampWritable(new Timestamp(1));
        }

        throw new IOException("next should only be called once");
      }
View Full Code Here

     try {
       // Create a file system handle
       fs = FileSystem.get(conf);  
       job = new JobConf(conf, ExecDriver.class);
      
        mSerde = new LazySimpleSerDe();
       Properties mSerdeProp = new Properties();
       mSerdeProp.put(Constants.SERIALIZATION_FORMAT, "" + Utilities.tabCode);
       mSerdeProp.put(Constants.SERIALIZATION_NULL_FORMAT, ((fetchWork)work).getSerializationNullFormat());
       mSerde.initialize(job, mSerdeProp);
      
View Full Code Here

  public void testLazySimpleSerDe() throws Throwable {
    try {
      // Create the SerDe
      System.out.println("test: testLazySimpleSerDe");
      LazySimpleSerDe serDe = new LazySimpleSerDe();
      Configuration conf = new Configuration();
      Properties tbl = createProperties();
      serDe.initialize(conf, tbl);

      // Data
      Text t = new Text("123\t456\t789\t1000\t5.3\thive and hadoop\t1.\tNULL");
      // Test
      deserializeAndSerializeLazySimple(serDe, t);
View Full Code Here

   
     try {
       // Create a file system handle 
       JobConf job = new JobConf(conf, ExecDriver.class);

       mSerde = new LazySimpleSerDe();
       Properties mSerdeProp = new Properties();
       mSerdeProp.put(Constants.SERIALIZATION_FORMAT, "" + Utilities.tabCode);
       mSerdeProp.put(Constants.SERIALIZATION_NULL_FORMAT, ((fetchWork)work).getSerializationNullFormat());
       mSerde.initialize(job, mSerdeProp);
       mSerde.setUseJSONSerialize(true);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

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.