cloud-fan commented on code in PR #39332:
URL: https://github.com/apache/spark/pull/39332#discussion_r1064768531
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala:
##########
@@ -259,4 +259,48 @@ object ParserUtils {
}
}
}
+
+ private def stripGap(sb: StringBuilder): Unit = {
+ if (sb.length > 0 && sb.charAt(sb.length - 1) == ' ') {
+ sb.setLength(sb.length - 1)
+ }
+ }
+
+ /**
+ * Adds a gap after every term node except of '(', ')', '[', ']',
+ * and removes a gap before '(', ')', '[', ']', ','.
+ */
+ private def toExprAlias(ctx: ParseTree, sb: StringBuilder): Unit = {
+ val childCount = ctx.getChildCount
+ if (childCount > 0) {
Review Comment:
seems we can remove the `if`, as the while loop is noop if count is 0.
--
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]