panbingkun commented on code in PR #41367:
URL: https://github.com/apache/spark/pull/41367#discussion_r1209654342


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -36,8 +37,8 @@ private[sql] object QueryParsingErrors extends 
QueryErrorsBase {
     new ParseException(errorClass = "_LEGACY_ERROR_TEMP_0001", ctx)
   }
 
-  def insertOverwriteDirectoryUnsupportedError(ctx: InsertIntoContext): 
Throwable = {
-    new ParseException(errorClass = "_LEGACY_ERROR_TEMP_0002", ctx)
+  def insertOverwriteDirectoryUnsupportedError(): Throwable = {
+    SparkException.internalError("INSERT OVERWRITE DIRECTORY is not 
supported.")

Review Comment:
   Although the above exception will be triggered when executing 
`visitInsertOverwriteDir` and `visitInsertOverwriteHiveDir ` in AstBuilder, our 
user is using the `SparkSqlAstBuilder` class, which extends AstBuilder and has 
overridden the `visitInsertOverwriteDir` and `visitInsertOverwriteHiveDir` 
methods and will not trigger the above logic.
   
   - AstBuilder `visitInsertOverwriteDir` and `visitInsertOverwriteHiveDir`
   
https://github.com/apache/spark/blob/014dd357656106cc8dc0fcfb30cbe067a714916c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala#L368-L382
   
   - SparkSqlAstBuilder `visitInsertOverwriteDir` and 
`visitInsertOverwriteHiveDir`
   
https://github.com/apache/spark/blob/88f69d6f92860823b1a90bc162ebca2b7c8132fc/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala#L802-L834
   
   
https://github.com/apache/spark/blob/88f69d6f92860823b1a90bc162ebca2b7c8132fc/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala#L848-L866
   



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