protected AbstractSerDe createSerDe() throws SerDeException { return new LazyBinarySerDe(); }
protected static AbstractSerDe createLazyBinarySerDe(Configuration cfg, StructObjectInspector oi, Map<String, String> serdePropsMap) throws SerDeException { serdePropsMap = serdePropsMap == null ? new LinkedHashMap<String, String>() : serdePropsMap; PTFDeserializer.addOIPropertiestoSerDePropsMap(oi, serdePropsMap); AbstractSerDe serDe = new LazyBinarySerDe(); Properties p = new Properties(); p.setProperty(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS)); p.setProperty( org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES)); SerDeUtils.initializeSerDe(serDe, cfg, p, null); return serDe; }
protected static AbstractSerDe createLazyBinarySerDe(Configuration cfg, StructObjectInspector oi, Map<String, String> serdePropsMap) throws SerDeException { serdePropsMap = serdePropsMap == null ? new LinkedHashMap<String, String>() : serdePropsMap; PTFDeserializer.addOIPropertiestoSerDePropsMap(oi, serdePropsMap); AbstractSerDe serDe = new LazyBinarySerDe(); Properties p = new Properties(); p.setProperty(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS)); p.setProperty( org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES)); SerDeUtils.initializeSerDe(serDe, cfg, p, null); return serDe; }
@BeforeClass public static void setupClass() throws SerDeException { cfg = new Configuration(); serDe = new LazyBinarySerDe(); Properties p = new Properties(); p.setProperty(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS, COL_NAMES); p.setProperty( org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES, COL_TYPES); SerDeUtils.initializeSerDe(serDe, cfg, p, null); }
static MapJoinKeyObject serde(MapJoinKeyObject key, String columns, String types) throws Exception { MapJoinKeyObject result = new MapJoinKeyObject(); ByteArrayInputStream bais; ObjectInputStream in; ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); LazyBinarySerDe serde = new LazyBinarySerDe(); Properties props = new Properties(); props.put(serdeConstants.LIST_COLUMNS, columns); props.put(serdeConstants.LIST_COLUMN_TYPES, types); SerDeUtils.initializeSerDe(serde, null, props, null); MapJoinObjectSerDeContext context = new MapJoinObjectSerDeContext(serde, false); key.write(context, out); out.close(); bais = new ByteArrayInputStream(baos.toByteArray()); in = new ObjectInputStream(bais); result.read(context, in, new BytesWritable()); return result; }
static MapJoinEagerRowContainer serde( MapJoinRowContainer container, String columns, String types) throws Exception { MapJoinEagerRowContainer result = new MapJoinEagerRowContainer(); ByteArrayInputStream bais; ObjectInputStream in; ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); LazyBinarySerDe serde = new LazyBinarySerDe(); Properties props = new Properties(); props.put(serdeConstants.LIST_COLUMNS, columns); props.put(serdeConstants.LIST_COLUMN_TYPES, types); SerDeUtils.initializeSerDe(serde, null, props, null); MapJoinObjectSerDeContext context = new MapJoinObjectSerDeContext(serde, true); container.write(context, out); out.close(); bais = new ByteArrayInputStream(baos.toByteArray()); in = new ObjectInputStream(bais); result.read(context, in, new BytesWritable()); return result; } }
@Before public void setup() throws Exception { key = new MapJoinKeyObject(KEY); rowContainer = new MapJoinEagerRowContainer(); rowContainer.addRow(VALUE); baos = new ByteArrayOutputStream(); out = new ObjectOutputStream(baos); LazyBinarySerDe keySerde = new LazyBinarySerDe(); Properties keyProps = new Properties(); keyProps.put(serdeConstants.LIST_COLUMNS, "v1"); keyProps.put(serdeConstants.LIST_COLUMN_TYPES, "string"); SerDeUtils.initializeSerDe(keySerde, null, keyProps, null); LazyBinarySerDe valueSerde = new LazyBinarySerDe(); Properties valueProps = new Properties(); valueProps.put(serdeConstants.LIST_COLUMNS, "v1"); valueProps.put(serdeConstants.LIST_COLUMN_TYPES, "string"); SerDeUtils.initializeSerDe(valueSerde, null, keyProps, null); containerSerde = new MapJoinTableContainerSerDe( new MapJoinObjectSerDeContext(keySerde, false), new MapJoinObjectSerDeContext(valueSerde, false)); container = new HashMapWrapper(); }
Configuration cfg = new Configuration(); RowContainer result = new RowContainer(blockSize, cfg, null); LazyBinarySerDe serde = new LazyBinarySerDe(); Properties props = new Properties(); props.put(serdeConstants.LIST_COLUMNS, "x");
protected AbstractSerDe createSerDe() throws SerDeException { return new LazyBinarySerDe(); }
protected static SerDe createLazyBinarySerDe(Configuration cfg, StructObjectInspector oi, Map<String, String> serdePropsMap) throws SerDeException { serdePropsMap = serdePropsMap == null ? new LinkedHashMap<String, String>() : serdePropsMap; PTFDeserializer.addOIPropertiestoSerDePropsMap(oi, serdePropsMap); SerDe serDe = new LazyBinarySerDe(); Properties p = new Properties(); p.setProperty(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS)); p.setProperty( org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES, serdePropsMap.get(org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES)); SerDeUtils.initializeSerDe(serDe, cfg, p, null); return serDe; }