diff --git a/ppl-spark-integration/README.md b/ppl-spark-integration/README.md index f73be5bb7..e7a206c20 100644 --- a/ppl-spark-integration/README.md +++ b/ppl-spark-integration/README.md @@ -224,6 +224,9 @@ This section describes the next steps planned for enabling additional commands a #### Example PPL Queries See the next samples of PPL queries : +**Describe** + - `describe table` This command is equal to the `DESCRIBE EXTENDED table` SQL command + **Fields** - `source = table` - `source = table | fields a,b,c` 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 812cbea82..e05230311 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 @@ -130,7 +130,7 @@ public LogicalPlan visitRelation(Relation node, CatalystPlanContext context) { new DescribeTableCommand( identifier, scala.collection.immutable.Map$.MODULE$.empty(), - false, + true, DescribeRelation$.MODULE$.getOutputAttrs())); } //regular sql algebraic relations diff --git a/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanBasicQueriesTranslatorTestSuite.scala b/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanBasicQueriesTranslatorTestSuite.scala index 6d34e3db9..14f45d50b 100644 --- a/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanBasicQueriesTranslatorTestSuite.scala +++ b/ppl-spark-integration/src/test/scala/org/opensearch/flint/spark/ppl/PPLLogicalPlanBasicQueriesTranslatorTestSuite.scala @@ -47,7 +47,7 @@ class PPLLogicalPlanBasicQueriesTranslatorTestSuite val expectedPlan = DescribeTableCommand( TableIdentifier("t"), Map.empty[String, String], - isExtended = false, + isExtended = true, output = DescribeRelation.getOutputAttrs) comparePlans(expectedPlan, logPlan, false) } @@ -60,7 +60,7 @@ class PPLLogicalPlanBasicQueriesTranslatorTestSuite val expectedPlan = DescribeTableCommand( TableIdentifier("t", Option("catalog")), Map.empty[String, String].empty, - isExtended = false, + isExtended = true, output = DescribeRelation.getOutputAttrs) comparePlans(expectedPlan, logPlan, false) }