From 302ed85902ab92817444b797cb86a6f583287dd6 Mon Sep 17 00:00:00 2001 From: Andy Kwok Date: Fri, 10 Jan 2025 15:57:15 -0800 Subject: [PATCH] Fix test Signed-off-by: Andy Kwok --- .../protector/OpenSearchExecutionProtector.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/OpenSearchExecutionProtector.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/OpenSearchExecutionProtector.java index 0ffa859d2b..e4423b5df9 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/OpenSearchExecutionProtector.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/OpenSearchExecutionProtector.java @@ -97,12 +97,14 @@ public PhysicalPlan visitRemove(RemoveOperator node, Object context) { @Override public PhysicalPlan visitEval(EvalOperator node, Object context) { - OpenSearchEvalOperator evalOperator = (OpenSearchEvalOperator) node; - return doProtect( - new OpenSearchEvalOperator( - visitInput(evalOperator.getInput(), context), - evalOperator.getExpressionList(), - evalOperator.getNodeClient())); + if (node instanceof OpenSearchEvalOperator evalOperator) { + return doProtect( + new OpenSearchEvalOperator( + visitInput(evalOperator.getInput(), context), + evalOperator.getExpressionList(), + evalOperator.getNodeClient())); + } + return new EvalOperator(visitInput(node.getInput(), context), node.getExpressionList()); } @Override