You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/05/03 11:32:57 UTC

[GitHub] [hudi] santoshsb commented on issue #5452: Schema Evolution: Missing column for previous records when new entry does not have the same while upsert.

santoshsb commented on issue #5452:
URL: https://github.com/apache/hudi/issues/5452#issuecomment-1115996169

   @xiarixiaoyao FYI, we just tested this issue by building the release branch 0.11.0, here is the JSON string and the schema.
   `{
     "resourceType": "Patient",
     "id": "596c7a94-bada-4303-85d4-7067c586999e",
     "lastUpdated": "2022-04-20T15:18:18.90836+05:30",
     "source": "4a0701fe-5c3b-482b-895d-875fcbd2148a",
     "name": [
       {
         "use": "official",
         "family": "Haley279",
         "given": [
           "Vinita997"
         ]
       }
     ],
     "gender": "female",
     "birthDate": "2005-08-30",
     "multipleBirthBoolean": false,
     "communication": [
       {
         "language": {
           "coding": [
             {
               "system": "urn:ietf:bcp:47",
               "code": "en-US",
               "display": "English"
             }
           ],
           "text": "English"
         }
       }
     ]
   }`
   
   SCHEMA
   
   scala> hudiPatientDF.printSchema
   root
    |-- _hoodie_commit_time: string (nullable = true)
    |-- _hoodie_commit_seqno: string (nullable = true)
    |-- _hoodie_record_key: string (nullable = true)
    |-- _hoodie_partition_path: string (nullable = true)
    |-- _hoodie_file_name: string (nullable = true)
    |-- birthDate: string (nullable = true)
    |-- communication: array (nullable = true)
    |    |-- element: struct (containsNull = true)
    |    |    |-- language: struct (nullable = true)
    |    |    |    |-- coding: array (nullable = true)
    |    |    |    |    |-- element: struct (containsNull = true)
    |    |    |    |    |    |-- code: string (nullable = true)
    |    |    |    |    |    |-- display: string (nullable = true)
    |    |    |    |    |    |-- system: string (nullable = true)
    |    |    |    |-- text: string (nullable = true)
    |-- gender: string (nullable = true)
    |-- id: string (nullable = true)
    |-- lastUpdated: string (nullable = true)
    |-- multipleBirthBoolean: boolean (nullable = true)
    |-- name: array (nullable = true)
    |    |-- element: struct (containsNull = true)
    |    |    |-- family: string (nullable = true)
    |    |    |-- given: array (nullable = true)
    |    |    |    |-- element: string (containsNull = true)
    |    |    |-- use: string (nullable = true)
    |-- resourceType: string (nullable = true)
    |-- source: string (nullable = true)
   
   We inserted the above JSON string and Updated the same, and it threw the following error which is same as above.
   
   `Caused by: org.apache.hudi.exception.HoodieException: unable to read next record from parquet file
     at org.apache.hudi.common.util.ParquetReaderIterator.hasNext(ParquetReaderIterator.java:53)
     at org.apache.hudi.common.util.queue.IteratorBasedQueueProducer.produce(IteratorBasedQueueProducer.java:45)
     at org.apache.hudi.common.util.queue.BoundedInMemoryExecutor.lambda$null$0(BoundedInMemoryExecutor.java:105)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
     ... 4 more
   Caused by: org.apache.parquet.io.InvalidRecordException: Parquet/Avro schema mismatch: Avro field 'coding' not found
     at org.apache.parquet.avro.AvroRecordConverter.getAvroField(AvroRecordConverter.java:221)
     at org.apache.parquet.avro.AvroRecordConverter.<init>(AvroRecordConverter.java:126)
     at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:284)
     at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:228)
     at org.apache.parquet.avro.AvroRecordConverter.access$100(AvroRecordConverter.java:74)
     at org.apache.parquet.avro.AvroRecordConverter$AvroCollectionConverter$ElementConverter.<init>(AvroRecordConverter.java:539)
     at org.apache.parquet.avro.AvroRecordConverter$AvroCollectionConverter.<init>(AvroRecordConverter.java:489)
     at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:293)
     at org.apache.parquet.avro.AvroRecordConverter.<init>(AvroRecordConverter.java:137)
     at org.apache.parquet.avro.AvroRecordConverter.<init>(AvroRecordConverter.java:91)
     at org.apache.parquet.avro.AvroRecordMaterializer.<init>(AvroRecordMaterializer.java:33)
     at org.apache.parquet.avro.AvroReadSupport.prepareForRead(AvroReadSupport.java:142)
     at org.apache.parquet.hadoop.InternalParquetRecordReader.initialize(InternalParquetRecordReader.java:185)
     at org.apache.parquet.hadoop.ParquetReader.initReader(ParquetReader.java:156)
     at org.apache.parquet.hadoop.ParquetReader.read(ParquetReader.java:135)
     at org.apache.hudi.common.util.ParquetReaderIterator.hasNext(ParquetReaderIterator.java:48)`
   
   Thanks,
   Santosh


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org