gideonkorir commented on a change in pull request #3509: NIFI-6295 fix
deserialization issues with NiFiRecordSerDe for hive3streaming
URL: https://github.com/apache/nifi/pull/3509#discussion_r315857808
##########
File path:
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/hive/streaming/NiFiRecordSerDe.java
##########
@@ -142,7 +138,27 @@ public SerDeStats getSerDeStats() {
public Object deserialize(Writable writable) throws SerDeException {
ObjectWritable t = (ObjectWritable) writable;
Record record = (Record) t.get();
- List<Object> r = new
ArrayList<>(Collections.nCopies(columnNames.size(), null));
+ return deserialize(record, schema, true);
+ }
+
+ /**
+ * Deserialize a record object into a Hive struct.
+ * @param record The record to deserialize, can be null
+ * @param structTypeInfo The hive table column info that corresponds to
the Hive struct
+ * @param isParentStruct Whether or not this struct is the one contained
by the Writable
+ */
+ Object deserialize(Record record, StructTypeInfo structTypeInfo, boolean
isParentStruct) throws SerDeException{
+ if(record == null){
+ return null;
+ }
+ Map<String, Integer> fieldPositionMap = null;
+ try {
+ fieldPositionMap = populateFieldPositionMap(record.getSchema(),
structTypeInfo, log);
Review comment:
I've checked out their code, will refactor to match what they've done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services