You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/22 12:50:59 UTC
[GitHub] [spark] gengliangwang commented on a change in pull request #35936: [SPARK-38616][SQL] Keep track of SQL query text in Catalyst TreeNode
gengliangwang commented on a change in pull request #35936:
URL: https://github.com/apache/spark/pull/35936#discussion_r832136166
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseDriver.scala
##########
@@ -80,11 +81,14 @@ abstract class AbstractSqlParser extends ParserInterface with SQLConfHelper with
/** Creates LogicalPlan for a given SQL string. */
override def parsePlan(sqlText: String): LogicalPlan = parse(sqlText) { parser =>
- astBuilder.visitSingleStatement(parser.singleStatement()) match {
- case plan: LogicalPlan => plan
- case _ =>
- val position = Origin(None, None)
- throw QueryParsingErrors.sqlStatementUnsupportedError(sqlText, position)
+ val ctx = parser.singleStatement()
+ withOrigin(ctx, Some(sqlText)) {
Review comment:
Different from https://github.com/apache/spark/pull/35926, here it passes the original SQL command to all the `Origin`s in the LogicalPlan. This can save memory usage, especially when the query is long.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org