dilipbiswal commented on a change in pull request #24385: [SPARK-27480][SQL]
Improve `EXPLAIN DESC QUERY` to show the input SQL statement
URL: https://github.com/apache/spark/pull/24385#discussion_r276850507
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -373,7 +374,11 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder(conf) {
* Create a [[DescribeQueryCommand]] logical command.
*/
override def visitDescribeQuery(ctx: DescribeQueryContext): LogicalPlan =
withOrigin(ctx) {
- DescribeQueryCommand(visitQuery(ctx.query))
+ val query = ctx.query
+ val startIndex = query.start.getStartIndex
+ val endIndex = query.stop.getStopIndex
+ val interval = new Interval(startIndex, endIndex)
+ DescribeQueryCommand(query.start.getInputStream.getText(interval),
visitQuery(ctx.query))
Review comment:
@dongjoon-hyun Thanks a lot. Actually after your comment yesterday, i had
started to code it up.. Here is the link to the branch for your perusal.
https://github.com/apache/spark/compare/master...dilipbiswal:describe_table_explain?expand=1
If you have some time and can quickly look through to see if the direction
is okay ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]