Package com.twitter.elephantbird.pig.util

Examples of com.twitter.elephantbird.pig.util.ThriftToPig


  public void testSetConversionProperties() throws ExecException {
    PhoneNumber pn = new PhoneNumber();
    pn.setNumber("1234");
    pn.setType(PhoneType.HOME);

    ThriftToPig ttp = ThriftToPig.newInstance(PhoneNumber.class);
    Tuple tuple = ttp.getPigTuple(pn);
    assertEquals(DataType.CHARARRAY, tuple.getType(1));
    assertEquals(PhoneType.HOME.toString(), tuple.get(1));

    Configuration conf = new Configuration();
    conf.setBoolean(ThriftToPig.USE_ENUM_ID_CONF_KEY, true);
    ThriftToPig.setConversionProperties(conf);
    tuple = ttp.getPigTuple(pn);
    assertEquals(DataType.INTEGER, tuple.getType(1));
    assertEquals(PhoneType.HOME.getValue(), tuple.get(1));
  }
View Full Code Here

TOP

Related Classes of com.twitter.elephantbird.pig.util.ThriftToPig

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.