From b9b0202676192fc206740ab76ff75ddea15545ee Mon Sep 17 00:00:00 2001 From: samik Date: Mon, 6 May 2024 22:46:04 +0530 Subject: [PATCH] CDAP-21024: Return null when there is no outputfield --- .../cdap/wrangler/schema/DirectiveOutputSchemaGenerator.java | 3 +++ 1 file changed, 3 insertions(+) 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); }