diff --git a/wrangler-core/src/main/java/io/cdap/wrangler/schema/DirectiveOutputSchemaGenerator.java b/wrangler-core/src/main/java/io/cdap/wrangler/schema/DirectiveOutputSchemaGenerator.java index cfac41804..a5e3ddc6f 100644 --- a/wrangler-core/src/main/java/io/cdap/wrangler/schema/DirectiveOutputSchemaGenerator.java +++ b/wrangler-core/src/main/java/io/cdap/wrangler/schema/DirectiveOutputSchemaGenerator.java @@ -103,6 +103,9 @@ private Schema generateDirectiveOutputSchema(Schema inputSchema) outputFields.add(Schema.Field.of(fieldName, Schema.of(Schema.Type.NULL))); } } + if (outputFields.isEmpty()) { + return null; + } return Schema.recordOf("output", outputFields); }