dongjoon-hyun 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_r276845802
##########
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)
Review comment:
nit. Can we remove the one-time used variables?
```scala
- val startIndex = query.start.getStartIndex
- val endIndex = query.stop.getStopIndex
- val interval = new Interval(startIndex, endIndex)
+ val interval = new Interval(query.start.getStartIndex,
query.stop.getStopIndex)
```
----------------------------------------------------------------
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]