Zouxxyy opened a new pull request, #9554:
URL: https://github.com/apache/hudi/pull/9554

   …Format
   
   ### Change Logs
   
   Currently, After doing schema evalution using spark-sql, query using hive 
will fail
   
   ```sql
   -- spark-sql
   set hoodie.schema.on.read.enable=true;
   
   create table hudi_mor_test_tbl (
     id bigint,
     name string,
     ts int,
     dt string,
     hh string
   ) using hudi
   tblproperties (
     type = 'mor',
     primaryKey = 'id',
     preCombineField = 'ts'
   )
   partitioned by (dt, hh);
   
   insert into hudi_mor_test_tbl values (1, 'a1', 1001, '2021-12-09', '10');
   
   ALTER TABLE hudi_mor_test_tbl ALTER COLUMN ts TYPE bigint;
   
   -- hive
   select * from hudi_mor_test_tbl_rt;
   
   Failed with exception java.io.IOException:java.lang.ClassCastException: 
org.apache.hadoop.io.LongWritable cannot be cast to 
org.apache.hadoop.io.IntWritable
   ```
   
   The root cause is that `FileInputFormat` does not implement 
`SelfDescribingInputFormatInterface`, see
   
   ```java
   /**
    * Marker interface to indicate a given input format is self-describing and
    * can perform schema evolution itself.
    */
   public interface SelfDescribingInputFormatInterface {
   
   }
   ```
   
   ### Impact
   
    After doing schema evalution using spark-sql, query using hive will success
   
   ### Risk level (write none, low medium or high below)
   
   none
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


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