wombatu-kun commented on code in PR #21096:
URL: https://github.com/apache/hudi/pull/21096#discussion_r4810404715
##########
hudi-trino/src/main/java/io/trino/plugin/hudi/HudiUtil.java:
##########
@@ -494,13 +495,25 @@ public static List<HiveColumnHandle>
appendMissingSchemaColumns(HoodieSchema dat
List<HiveColumnHandle> columns = new ArrayList<>(projection);
for (HoodieSchemaField field : dataSchema.getFields()) {
- if (existingColumns.add(field.name().toLowerCase(Locale.ROOT))) {
+ if (!isNullOnly(field) &&
existingColumns.add(field.name().toLowerCase(Locale.ROOT))) {
Review Comment:
This only checks top-level fields, so an unprojected record containing a
direct `null` member still reaches `toColumnHandle` and fails with `No null
column type support`. Filter null-only members when recursively mapping record
schemas, and add a nested-field merge test.
##########
hudi-trino/src/test/java/io/trino/plugin/hudi/TestHudiUtilColumnHandles.java:
##########
@@ -155,6 +155,23 @@ public void testAppendMissingSchemaColumns()
assertThat(expanded.get(2).getType()).isEqualTo(INTEGER);
}
+ @Test
+ public void testAppendMissingSchemaColumnsSkipsNullOnlyFields()
Review Comment:
`appendMissingMergeRequiredColumns` has no regression coverage for its new
null-only guard, and the updated fixture always takes the full-schema branch
instead. Add a null-only ordering or merger-required field case that asserts
the field is omitted while ordinary required columns remain.
--
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]