Github user nblintao commented on a diff in the pull request:
https://github.com/apache/spark/pull/14158#discussion_r118998888
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseDriver.scala
---
@@ -50,13 +50,29 @@ abstract class AbstractSqlParser extends
ParserInterface with Logging {
}
/** 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 new ParseException(Option(sqlText), "Unsupported SQL
statement", position, position)
+ override def parsePlan(sqlText: String): LogicalPlan = {
+ val logicalPlan = parse(sqlText) { parser =>
+ astBuilder.visitSingleStatement(parser.singleStatement()) match {
+ case plan: LogicalPlan => plan
+ case _ =>
+ val position = Origin(None, None)
+ throw new ParseException(Option(sqlText), "Unsupported SQL
statement", position, position)
+ }
+ }
+ // Record the original sql text in the top logical plan for checking
in the web UI.
+ // Truncate the text to avoid downing browsers or web UI servers by
running out of memory.
+ val maxLength = 1000
+ val suffix = " ... (truncated)"
+ val truncateLength = maxLength - suffix.length
--- End diff --
I think either way is okay. Here, I am considering keeping the text
displayed (including suffix) less than 1000 chars.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]