diff --git a/ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java b/ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java index 575537826..67f1fdef9 100644 --- a/ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java +++ b/ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java @@ -364,7 +364,7 @@ private static List getoverridedlist(LogicalPlan lp, String tableNam // then apply a dfDropColumns on main-search to avoid duplicate fields. SparkSession sparkSession = SparkSession.getActiveSession().get(); QueryExecution queryExecutionSub = sparkSession.sessionState() - .executePlan(lp, CommandExecutionMode.ALL()); + .executePlan(lp, CommandExecutionMode.SKIP()); Seq output = queryExecutionSub.analyzed().output(); List attributes = seqAsJavaList(output); return attributes.stream() @@ -380,7 +380,6 @@ private org.apache.spark.sql.catalyst.plans.logical.SubqueryAlias getRowNumStarP UTF8String.fromString("1"), DataTypes.StringType), false); NamedExpression appendCol = WindowSpecTransformer.buildRowNumber(seq(), seq(sortOrder)); - List projectList = (context.getNamedParseExpressions().isEmpty()) ? List.of(appendCol, new UnresolvedStar(Option.empty())) : List.of(appendCol);