n3nash commented on a change in pull request #674: Upgrade to Hive 2.x, MOR
read query fixes and performance improvement
URL: https://github.com/apache/incubator-hudi/pull/674#discussion_r292097497
##########
File path:
hoodie-hadoop-mr/src/main/java/com/uber/hoodie/hadoop/realtime/AbstractRealtimeRecordReader.java
##########
@@ -121,22 +130,34 @@ private static MessageType readSchema(Configuration
conf, Path parquetFilePath)
}
}
+ /**
+ * Prints a JSON representation of the ArrayWritable for easier debuggability
+ * @param writable
+ * @return
+ */
protected static String arrayWritableToString(ArrayWritable writable) {
if (writable == null) {
return "null";
}
-
StringBuilder builder = new StringBuilder();
Writable[] values = writable.get();
- builder.append(String.format("(Size: %s)[", values.length));
+ builder.append("\"values_" + Math.random() + "_" + values.length + "\":
{");
Review comment:
So, this refactor is to have a better readable string representation of
Writables. For eg,
```
"value12": "null",
"type12": "unknown",
"value13": "null",
"type13": "unknown",
"value14": "abc",
"type14": "Text",
"value15": "1433",
"type15": "IntWritable",
"value16": "null",
"type16": "unknown",
"value17": "null",
"type17": "unknown",
"value18": "null",
"type18": "unknown",
"value19": "1556838438",
"type19": "Text",
"value20": "1208632396",
"type20": "LongWritable",
```
To generate this json, need unique values to be appended to the "type" and
"value" strings else JSON breaks.
----------------------------------------------------------------
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