From e34c0c6d235a00ee1a2674cbb7fa9067370d710f Mon Sep 17 00:00:00 2001 From: YANGDB Date: Tue, 6 Aug 2024 22:39:33 -0700 Subject: [PATCH] update visitRelation with DescribeTableCommand ctor Signed-off-by: YANGDB --- .../org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 4fafb6304..c2ddb03e6 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 @@ -14,6 +14,7 @@ import org.apache.spark.sql.catalyst.expressions.Predicate; import org.apache.spark.sql.catalyst.expressions.SortOrder; import org.apache.spark.sql.catalyst.plans.logical.Aggregate; +import org.apache.spark.sql.catalyst.plans.logical.DescribeRelation$; import org.apache.spark.sql.catalyst.plans.logical.Limit; import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan; import org.apache.spark.sql.execution.command.DescribeTableCommand; @@ -111,7 +112,12 @@ public LogicalPlan visitExplain(Explain node, CatalystPlanContext context) { @Override public LogicalPlan visitRelation(Relation node, CatalystPlanContext context) { if (node instanceof DescribeRelation) { - return context.with(new DescribeTableCommand(new TableIdentifier(node.getTableQualifiedName().toString()), null, false, seq())); + return context.with( + new DescribeTableCommand( + new TableIdentifier(node.getTableQualifiedName().toString()), + scala.collection.immutable.Map$.MODULE$.empty(), + false, + DescribeRelation$.MODULE$.getOutputAttrs())); } //regular sql algebraic relations node.getTableName().forEach(t ->