protected SerDeInfo buildSerde() { SerDeInfo serDeInfo = new SerDeInfo(serdeName, serdeLib, serdeParams); if (serdeDescription != null) serDeInfo.setDescription(serdeDescription); if (serdeSerializerClass != null) serDeInfo.setSerializerClass(serdeSerializerClass); if (serdeDeserializerClass != null) serDeInfo.setDeserializerClass(serdeDeserializerClass); if (serdeType != null) serDeInfo.setSerdeType(serdeType); return serDeInfo; }
unsetSerdeType(); } else { setSerdeType((SerdeType)value);
private SerDeInfo convertToSerDeInfo(MSerDeInfo ms, boolean allowNull) throws MetaException { if (ms == null) { if (allowNull) { return null; } throw new MetaException("Invalid SerDeInfo object"); } SerDeInfo serde = new SerDeInfo(ms.getName(), ms.getSerializationLib(), convertMap(ms.getParameters())); if (ms.getDescription() != null) { serde.setDescription(ms.getDescription()); } if (ms.getSerializerClass() != null) { serde.setSerializerClass(ms.getSerializerClass()); } if (ms.getDeserializerClass() != null) { serde.setDeserializerClass(ms.getDeserializerClass()); } if (ms.getSerdeType() > 0) { serde.setSerdeType(SerdeType.findByValue(ms.getSerdeType())); } return serde; }
@Test public void addSerde() throws TException { String serdeName = uniqueSerdeName(); SerDeInfo serDeInfo = new SerDeInfo(serdeName, "serdeLib", Collections.singletonMap("a", "b")); serDeInfo.setSerializerClass("serializer"); serDeInfo.setDeserializerClass("deserializer"); serDeInfo.setDescription("description"); serDeInfo.setSerdeType(SerdeType.SCHEMA_REGISTRY); client.addSerDe(serDeInfo); serDeInfo = client.getSerDe(serdeName); Assert.assertEquals(serdeName, serDeInfo.getName()); Assert.assertEquals("serdeLib", serDeInfo.getSerializationLib()); Assert.assertEquals(1, serDeInfo.getParametersSize()); Assert.assertEquals("b", serDeInfo.getParameters().get("a")); Assert.assertEquals("serializer", serDeInfo.getSerializerClass()); Assert.assertEquals("deserializer", serDeInfo.getDeserializerClass()); Assert.assertEquals("description", serDeInfo.getDescription()); Assert.assertEquals(SerdeType.SCHEMA_REGISTRY, serDeInfo.getSerdeType()); }
protected SerDeInfo buildSerde() { SerDeInfo serDeInfo = new SerDeInfo(serdeName, serdeLib, serdeParams); if (serdeDescription != null) serDeInfo.setDescription(serdeDescription); if (serdeSerializerClass != null) serDeInfo.setSerializerClass(serdeSerializerClass); if (serdeDeserializerClass != null) serDeInfo.setDeserializerClass(serdeDeserializerClass); if (serdeType != null) serDeInfo.setSerdeType(serdeType); return serDeInfo; }
private StorageDescriptor storageDescriptor(Schema schema) { final StorageDescriptor storageDescriptor = new StorageDescriptor(); storageDescriptor.setCols(columns(schema)); storageDescriptor.setLocation(hiveTableLocation()); storageDescriptor.setOutputFormat("org.apache.hadoop.mapred.FileInputFormat"); storageDescriptor.setInputFormat("org.apache.hadoop.mapred.FileOutputFormat"); SerDeInfo serDeInfo = new SerDeInfo(); serDeInfo.setSerdeType(SerdeType.HIVE); serDeInfo.setSerializationLib("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"); storageDescriptor.setSerdeInfo(serDeInfo); return storageDescriptor; }
private SerDeInfo convertToSerDeInfo(MSerDeInfo ms) throws MetaException { if (ms == null) { throw new MetaException("Invalid SerDeInfo object"); } SerDeInfo serde = new SerDeInfo(ms.getName(), ms.getSerializationLib(), convertMap(ms.getParameters())); if (ms.getDescription() != null) { serde.setDescription(ms.getDescription()); } if (ms.getSerializerClass() != null) { serde.setSerializerClass(ms.getSerializerClass()); } if (ms.getDeserializerClass() != null) { serde.setDeserializerClass(ms.getDeserializerClass()); } if (ms.getSerdeType() > 0) { serde.setSerdeType(SerdeType.findByValue(ms.getSerdeType())); } return serde; }
unsetSerdeType(); } else { setSerdeType((SerdeType)value);