From fcb6209ab98803029804be95baa91e1e21b73f39 Mon Sep 17 00:00:00 2001 From: Fernando Velasquez Date: Wed, 5 Apr 2023 14:31:50 -0400 Subject: [PATCH] [PLUGIN-1572] Added error message when Wrangler uses SQL filters and the wrangler stage has more than 1 inputs --- .../src/main/java/io/cdap/wrangler/Wrangler.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java b/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java index 340750d62..89a95403c 100644 --- a/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java +++ b/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java @@ -381,6 +381,15 @@ public void destroy() { */ @Override public void transform(StructuredRecord input, Emitter emitter) throws Exception { + // The Transform function should never execute if SQL filters are enabled. SQL filters are + // handled by the LinearRelationalTransform implementation. If this code is reached, it means + // the LinearRelationalTransform could not be executed correctly. + if (PRECONDITION_LANGUAGE_SQL.equals(config.getPreconditionLanguage())) { + throw new IllegalArgumentException("SQL filters are not supported with " + + "multiple input stages. Please ensure the Wrangler stages with SQL " + + "filters have only one input."); + } + long start = 0; List records;