You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/05/30 02:37:44 UTC

[GitHub] [spark] panbingkun commented on a diff in pull request #41367: [SPARK-43862][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_(1254 & 1315)

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


##########
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:
   1.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`
   



-- 
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-unsubscribe@spark.apache.org

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


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