milastdbx commented on code in PR #45896:
URL: https://github.com/apache/spark/pull/45896#discussion_r1565726777


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -32,6 +32,22 @@ class QueryParsingErrorsSuite extends QueryTest with 
SharedSparkSession with SQL
     intercept[ParseException](sql(sqlText).collect())
   }
 
+  test("PARSE_STACK_OVERFLOW_ERROR: Stack overflow hit") {

Review Comment:
   ![Uploading image.png…]()
   



##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -32,6 +32,22 @@ class QueryParsingErrorsSuite extends QueryTest with 
SharedSparkSession with SQL
     intercept[ParseException](sql(sqlText).collect())
   }
 
+  test("PARSE_STACK_OVERFLOW_ERROR: Stack overflow hit") {

Review Comment:
   1sec 168ms



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AbstractSqlParser.scala:
##########
@@ -30,50 +32,74 @@ abstract class AbstractSqlParser extends AbstractParser 
with ParserInterface {
   override def astBuilder: AstBuilder
 
   /** Creates Expression for a given SQL string. */
-  override def parseExpression(sqlText: String): Expression = parse(sqlText) { 
parser =>
-    val ctx = parser.singleExpression()
-    withOrigin(ctx, Some(sqlText)) {
-      astBuilder.visitSingleExpression(ctx)
+  override def parseExpression(sqlText: String): Expression =
+    parse(sqlText) { parser =>

Review Comment:
   I dont think we can, as we need context for proper error reporting but 
context can only be given by lambda executed by parse method



-- 
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]

Reply via email to