voonhous commented on code in PR #14382:
URL: https://github.com/apache/hudi/pull/14382#discussion_r2593326831
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/schema/SchemaProvider.java:
##########
@@ -18,21 +18,60 @@
package org.apache.hudi.schema;
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.common.schema.HoodieSchema;
+
import org.apache.avro.Schema;
import java.io.Serializable;
/**
* Class to provide schema for reading data and also writing into a Hoodie
table.
+ * This class mirrors org.apache.hudi.utilities.schema.SchemaProvider.
*/
public abstract class SchemaProvider implements Serializable {
private static final long serialVersionUID = 1L;
- public abstract Schema getSourceSchema();
+ /**
+ * Fetches the source schema from the provider.
+ * @return Source schema as a HoodieSchema object.
+ */
+ @PublicAPIMethod(maturity = ApiMaturityLevel.STABLE)
+ public abstract HoodieSchema getSourceHoodieSchema();
+
+ /**
+ * Fetches the source schema from the provider.
+ * @return Source schema as an Avro Schema object.
+ * @deprecated since 1.2.0, use {@link #getSourceHoodieSchema()} instead.
+ */
+ @PublicAPIMethod(maturity = ApiMaturityLevel.DEPRECATED)
+ @Deprecated
+ public Schema getSourceSchema() {
+ throw new UnsupportedOperationException("getSourceSchema() is deprecated
and is not implemented for this SchemaProvider. Use getSourceHoodieSchema()
instead.");
+ }
+ /**
+ * Fetches the target schema from the provider, defaults to the source
schema.
+ * @return Target schema as a HoodieSchema object.
+ */
+ @PublicAPIMethod(maturity = ApiMaturityLevel.STABLE)
+ public HoodieSchema getTargetHoodieSchema() {
+ // by default, use source schema as target for hoodie table as well
+ return getSourceHoodieSchema();
Review Comment:
Done
--
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]