voonhous commented on code in PR #17833:
URL: https://github.com/apache/hudi/pull/17833#discussion_r2930142232
##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchema.java:
##########
@@ -2383,6 +2389,20 @@ public String getName() {
return VARIANT_DEFAULT_NAME;
}
+ /**
+ * Returns the type of this schema.
+ * Note: This override is not strictly necessary as the base class
constructor
+ * already sets the type correctly via HoodieSchemaType.fromAvro() which
detects
+ * the VariantLogicalType. This explicit override is provided for
consistency
+ * with other logical type subclasses (e.g., Blob) and for clarity.
+ *
+ * @return HoodieSchemaType.VARIANT
+ */
+ @Override
+ public HoodieSchemaType getType() {
Review Comment:
There shouldn't be any silent breakage as every path either handles VARIANT
explicitly or has a default that throws.
The places that throw (Hive sync, BigQuery sync, etc.) are correct because
those engines don't support Variant yet.
Already handling VARIANT:
- `HoodieSchemaType.isComplex()`
- `HoodieSchemaCompatibilityChecker (both switches)`
- `InternalSchemaConverter.visitPrimitiveToBuildInternalType()`
Not handling VARIANT, but have defaults that throw (safe - will fail loudly):
- `HiveSchemaUtil.convertField() - throws UnsupportedOperationException`
- `SparkSchemaUtils.convertFieldType() - throws
UnsupportedOperationException`
- `HoodieSchemaComparatorForSchemaEvolution.schemaEqualsInternal() - throws
IllegalArgumentException`
- `HoodieTableMetadataUtil.coerceToComparable() - throws exception
- ProtoConversionUtil.convertObject() - has default
LMK if i miss out any
--
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]