voonhous commented on code in PR #19834:
URL: https://github.com/apache/hudi/pull/19834#discussion_r3940234095
##########
hudi-common/src/main/java/org/apache/hudi/metadata/stats/ValueType.java:
##########
@@ -294,7 +294,12 @@ public static ValueType fromSchema(HoodieSchema schema) {
case UUID:
return ValueType.UUID;
case UNION:
- return fromSchema(schema.getNonNullType());
+ HoodieSchema nonNullSchema = schema.getNonNullType();
+ if (nonNullSchema.getType() == HoodieSchemaType.UNION) {
+ throw new IllegalArgumentException("Unsupported union type " + schema
Review Comment:
No, it is not, and it has the same root cause as the `coerceToComparable`
thread: `isColumnTypeSupported`'s deny lists never named `UNION`, so the column
got indexed and the throw landed in that `catch (Exception)`.
`UNION` is now in the V1 and V2 lists, so the column is skipped before
either site is reached. The file's other columns keep their stats and nothing
is swallowed.
That also restores the symmetry this method already relies on:
`fromSchema`'s `default` arm throws `IllegalArgumentException` for
`RECORD`/`ARRAY`/`MAP`/`ENUM`, and the only reason that is not a problem is
that the deny list filters them first. `UNION` is now filtered the same way, so
this throw is a guard rather than something a table can trigger.
--
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]