Skip to content

Commit b6192e2

Browse files
committed
Fix compilation error after rebase
1 parent 902ad85 commit b6192e2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

hudi-common/src/main/java/org/apache/hudi/common/model/SerializableMetadataIndexedRecord.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package org.apache.hudi.common.model;
2121

22+
import org.apache.hudi.common.schema.HoodieSchema;
23+
import org.apache.hudi.common.schema.HoodieSchemaField;
2224
import org.apache.hudi.common.util.ValidationUtils;
2325
import org.apache.hudi.common.util.VisibleForTesting;
2426
import org.apache.hudi.exception.HoodieIOException;
@@ -46,8 +48,8 @@
4648

4749
public class SerializableMetadataIndexedRecord implements GenericRecord, KryoSerializable, Serializable {
4850
private static final long serialVersionUID = 1L;
49-
private static final ConcurrentHashMap<Schema, GenericDatumReader<GenericRecord>> CACHED_DATUM_READER_MAP = new ConcurrentHashMap<>();
50-
private static final ConcurrentHashMap<Schema, Schema.Field> CACHED_KEY_SCHEMA_MAP = new ConcurrentHashMap<>();
51+
private static final ConcurrentHashMap<HoodieSchema, GenericDatumReader<GenericRecord>> CACHED_DATUM_READER_MAP = new ConcurrentHashMap<>();
52+
private static final ConcurrentHashMap<Schema, HoodieSchemaField> CACHED_KEY_SCHEMA_MAP = new ConcurrentHashMap<>();
5153
private IndexedRecord record;
5254
private Schema schema;
5355
// TODO(yihua): need to have a better way of referencing this reader
@@ -74,7 +76,7 @@ private SerializableMetadataIndexedRecord(Schema schema,
7476

7577
public static SerializableMetadataIndexedRecord fromHFileKeyValueBytes(Schema schema,
7678
GenericDatumReader<GenericRecord> datumReader,
77-
Schema.Field keyFieldSchema,
79+
HoodieSchemaField keyFieldSchema,
7880
KeyValue hfileKeyValue) {
7981
CACHED_KEY_SCHEMA_MAP.computeIfAbsent(schema, k -> keyFieldSchema);
8082
return new SerializableMetadataIndexedRecord(

hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReaderImplBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static List<IndexedRecord> readRecords(HoodieAvroHFileReaderImplBase read
8686
}
8787
}
8888

89-
protected static GenericRecord deserialize(String key,
89+
public static GenericRecord deserialize(String key,
9090
final byte[] valueBytes, int valueOffset, int valueLength,
9191
GenericDatumReader<GenericRecord> datumReader,
9292
HoodieSchemaField keyFieldSchema) throws IOException {

hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.apache.hudi.storage.StoragePath;
4444
import org.apache.hudi.util.Lazy;
4545

46+
import org.apache.avro.Schema;
4647
import org.apache.avro.generic.GenericDatumReader;
4748
import org.apache.avro.generic.GenericRecord;
4849
import org.apache.avro.generic.IndexedRecord;
@@ -599,7 +600,7 @@ public boolean hasNext() {
599600
if (!isPrefixOfKey(lookUpKeyPrefix, keyValue.getKey())) {
600601
return false;
601602
}
602-
next = SerializableMetadataIndexedRecord.fromHFileKeyValueBytes(writerSchema, datumReader, keyFieldSchema, keyValue);
603+
next = SerializableMetadataIndexedRecord.fromHFileKeyValueBytes(writerSchema.getAvroSchema(), datumReader, keyFieldSchema, keyValue);
603604
// In case scanner is not able to advance, it means we reached EOF
604605
eof = !reader.next();
605606
} catch (IOException e) {

0 commit comments

Comments
 (0)