davidm-db commented on code in PR #46665:
URL: https://github.com/apache/spark/pull/46665#discussion_r1608197935


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AbstractSqlParser.scala:
##########
@@ -91,6 +91,20 @@ abstract class AbstractSqlParser extends AbstractParser with 
ParserInterface {
     }
   }
 
+  /** Creates BatchBody for a given SQL string. */
+  override def parseBatch(sqlText: String): BatchBody = parse(sqlText) { 
parser =>
+    val ctx = parser.batchOrSingleStatement()
+    withErrorHandling(ctx, Some(sqlText)) {
+      astBuilder.visitBatchOrSingleStatement(ctx) match {
+        case batch: BatchBody => batch
+        case _ =>
+          // TODO: Figure out the error reporting - this is just copy paste of 
parsePlan logic.

Review Comment:
   We synced offline and decided to leave "Unsupported SQL statement" exception 
here as in `parsePlan`. As already explained, all meaningful exceptions during 
parsing, interpreting, executing, etc. would be thrown elsewhere.
   
   This also brings down the scope of this PR to exclude exception support - 
which will be added anyways, and if we want we can easily change this exception 
here in the future.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to