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_r292106993
##########
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
Review comment:
So we get delete blocks for the keys that need to be deleted and then we
generate empty payloads for them -
https://github.com/apache/incubator-hudi/blob/master/hoodie-common/src/main/java/com/uber/hoodie/common/table/log/HoodieMergedLogRecordScanner.java#L123
so that during merge we know which row from the parquet we need to drop.
----------------------------------------------------------------
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