cloud-fan commented on code in PR #37209:
URL: https://github.com/apache/spark/pull/37209#discussion_r926408078
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:
##########
@@ -147,6 +166,16 @@ case class Origin(
builder.result()
}
}
+
+ /** Gets the textual fragment of a SQL query. */
+ def getFragment: String = {
+ if (sqlText.isEmpty || startIndex.isEmpty || stopIndex.isEmpty ||
+ startIndex.get < 0 || stopIndex.get >= sqlText.get.length ||
startIndex.get > stopIndex.get) {
+ ""
+ } else {
+ sqlText.get.substring(startIndex.get, stopIndex.get)
Review Comment:
We should do truncation to avoid big strings.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]