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

   ### Describe the issue this Pull Request addresses
   
   Closes #21077. Part of the #20757 split (see #17764).
   
   ### Summary and Changelog
   
   A merge read of a table with a field that can only hold null (`"null"`, or a 
union of nothing but `"null"`) failed with "No null column type support". The 
read path asked for a column type for the field. The Parquet writer does not 
write such a field and Hive sync does not register it, so there is nothing to 
read.
   
   - `HudiUtil.isNullOnly` identifies such a field.
   - `appendMissingSchemaColumns` (full-schema read of a 
non-projection-compatible merger) and `appendMissingMergeRequiredColumns` leave 
it out.
   - `HudiTrinoReaderContext` leaves it out of the log-file projection and of 
the base-projection check. The serializer leaves it null in the record, which 
is its only value.
   
   The non-projection-compatible merger fixture gains an `always_null` field. 
Without the fix, `TestHudiNonProjectionCompatibleMerger` fails two tests with 
the error above.
   
   #21074 adds `TrinoTypeMapper.isNullOnly(HoodieSchema)` with the same check. 
Whichever of the two lands second makes `HudiUtil.isNullOnly` delegate to it.
   
   ### Impact
   
   Merge reads of tables with a null-only field succeed instead of failing.
   
   ### Risk Level
   
   low
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


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