the-other-tim-brown commented on code in PR #13987:
URL: https://github.com/apache/hudi/pull/13987#discussion_r2388553740


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/index/bloom/TestHoodieGlobalBloomIndex.java:
##########
@@ -297,6 +297,8 @@ public void testTagLocation() throws Exception {
 
     for (HoodieRecord record : taggedRecordRDD.collect()) {
       IndexedRecord data = record.toIndexedRecord(SIMPLE_RECORD_SCHEMA, 
CollectionUtils.emptyProps()).get().getData();
+      // eager deser.
+      data.get(0);

Review Comment:
   Why do we need this?



##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/testutils/SparkClientFunctionalTestHarness.java:
##########
@@ -425,7 +426,7 @@ protected HoodieWriteConfig.Builder 
getConfigBuilder(Boolean autoCommit, Boolean
 
   protected Dataset<Row> toDataset(List<HoodieRecord> records, Schema schema) {
     List<GenericRecord> avroRecords = records.stream()
-        .map(r -> (GenericRecord) r.getData())
+        .map(r -> (GenericRecord) 
((SerializableIndexedRecord)r.getData()).getData())

Review Comment:
   `SerializableIndexedRecord` also implements `GenericRecord`, why do we need 
these extra steps?



##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/TestUpdateProcessor.java:
##########
@@ -174,6 +175,13 @@ void testHandleInsertWithPayload(boolean shouldIgnore) {
     }
   }
 
+  private static BufferedRecord<IndexedRecord> 
getRecordWithSerializableIndexedRecord(String value, HoodieOperation operation) 
{
+    GenericRecord record = new GenericData.Record(SCHEMA);
+    record.put("key", KEY);
+    record.put("value", value);
+    return new BufferedRecord<>(KEY, 1, new 
HoodieAvroIndexedRecord(record).getData(), 0, operation);

Review Comment:
   Now that the `SerializableIndexedRecord` creation is not package private, 
can we update this code to directly create an instance instead of going through 
the `HoodieAvroIndexedRecord`?



##########
hudi-common/src/main/java/org/apache/hudi/common/model/debezium/PostgresDebeziumAvroPayload.java:
##########
@@ -108,9 +108,9 @@ private void mergeToastedValuesIfPresent(IndexedRecord 
incomingRecord, IndexedRe
     fields.forEach(field -> {
       // There are only four avro data types that have unconstrained sizes, 
which are
       // NON-NULLABLE STRING, NULLABLE STRING, NON-NULLABLE BYTES, NULLABLE 
BYTES
-      if (((GenericData.Record) incomingRecord).get(field.name()) != null
+      if (((GenericRecord)incomingRecord).get(field.name()) != null

Review Comment:
   Nitpick: add space after casting



##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -318,6 +318,9 @@ public long getCurrentPosition() {
    */
   public void setIgnoreIndexUpdate(boolean ignoreFlag) {
     this.ignoreIndexUpdate = ignoreFlag;
+    if (ignoreFlag) {

Review Comment:
   I'm curious what requires this change or how things were working without it



##########
hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/io/TestMergeHandle.java:
##########
@@ -505,13 +506,13 @@ private InputAndExpectedDataSet 
prepareInputFor2ndBatch(HoodieWriteConfig config
     }
 
     // Generate records to update
-    GenericRecord genericRecord1 = (GenericRecord) newRecords.get(0).getData();
-    GenericRecord genericRecord2 = (GenericRecord) newRecords.get(1).getData();
+    GenericRecord genericRecord1 = (GenericRecord) 
((SerializableIndexedRecord)newRecords.get(0).getData()).getData();

Review Comment:
   Space after casting in this file as well



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to