bvaradar commented on code in PR #10288:
URL: https://github.com/apache/hudi/pull/10288#discussion_r1421097099
##########
hudi-common/src/main/java/org/apache/hudi/internal/schema/utils/AvroSchemaEvolutionUtils.java:
##########
@@ -140,10 +140,14 @@ public static Schema reconcileSchema(Schema
incomingSchema, Schema oldTableSchem
* @return schema (based off {@code source} one) that has nullability
constraints and datatypes reconciled
*/
public static Schema reconcileSchemaRequirements(Schema sourceSchema, Schema
targetSchema, Map<String, String> opts) {
- if (sourceSchema.getType() == Schema.Type.NULL ||
sourceSchema.getFields().isEmpty() || targetSchema.getFields().isEmpty()) {
+ if (targetSchema.getType() == Schema.Type.NULL ||
targetSchema.getFields().isEmpty()) {
Review Comment:
This will also be problematic when transformation schema is not fully
compatible with source schema. Can we take the approach if the input df is
empty, do not set schema ?
--
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]