pan3793 commented on code in PR #40823:
URL: https://github.com/apache/spark/pull/40823#discussion_r1168788733
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala:
##########
@@ -197,6 +197,12 @@ class PlanParserSuite extends AnalysisTest {
parameters = Map.empty)
}
+ test("select and union without parentheses") {
+ val plan = Distinct(OneRowRelation().select(Literal(1))
+ .union(OneRowRelation().select(Literal(1))))
+ assertEqual("select 1 union select 1", plan)
Review Comment:
Have done a quick check w/ the following change
```patch
- parser.setErrorHandler(new SparkParserErrorStrategy())
+ parser.setErrorHandler(new BailErrorStrategy())
```
```
sbt:spark-catalyst> testOnly *PlanParserSuite -- -z "select and union
without parentheses"
[warn] multiple main classes detected: run 'show discoveredMainClasses' to
see the list
[info] compiling 1 Scala source to
/Users/chengpan/Projects/apache-spark/sql/catalyst/target/scala-2.12/classes ...
[info] PlanParserSuite:
[info] - select and union without parentheses (364 milliseconds)
[info] Run completed in 1 second, 463 milliseconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 31 s, completed Apr 17, 2023 10:05:54 PM
```
--
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]