vinothchandar 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_r291870375
##########
File path:
hoodie-hadoop-mr/src/main/java/com/uber/hoodie/hadoop/realtime/RealtimeCompactedRecordReader.java
##########
@@ -96,26 +78,41 @@ public boolean next(Void aVoid, ArrayWritable
arrayWritable) throws IOException
// return from delta records map if we have some match.
String key =
arrayWritable.get()[HoodieRealtimeInputFormat.HOODIE_RECORD_KEY_COL_POS]
.toString();
- if (LOG.isDebugEnabled()) {
- LOG.debug(String.format("key %s, base values: %s, log values: %s", key,
- arrayWritableToString(arrayWritable),
arrayWritableToString(deltaRecordMap.get(key))));
- }
if (deltaRecordMap.containsKey(key)) {
// TODO(NA): Invoke preCombine here by converting arrayWritable to
Avro. This is required since the
// deltaRecord may not be a full record and needs values of columns
from the parquet
- Writable[] replaceValue = deltaRecordMap.get(key).get();
- if (replaceValue.length < 1) {
- // This record has been deleted, move to the next record
+ Optional<GenericRecord> rec;
+ if (usesCustomPayload) {
+ rec =
deltaRecordMap.get(key).getData().getInsertValue(getWriterSchema());
+ } else {
+ rec =
deltaRecordMap.get(key).getData().getInsertValue(getReaderSchema());
+ }
+ if (!rec.isPresent()) {
+ // If the record is not present, this is a delete record using an
empty payload so skip this base record
+ // and move to the next record
Review comment:
In general, the RecordReader is not handling inserts sent to logs? i.e the
base reader could be exhausted but still there could be entries in the
`deltaRecordMap`. correct? This still assumed that the log records are all
updates?
----------------------------------------------------------------
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