This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 49ca6aa6cb7 [MINOR][SQL] Pass `cause` in 
`CannotReplaceMissingTableException` costructor
49ca6aa6cb7 is described below

commit 49ca6aa6cb75b931d1c38dcffb4cd3dd63b0a2f3
Author: Max Gekk <max.g...@gmail.com>
AuthorDate: Fri Nov 10 12:17:09 2023 +0300

    [MINOR][SQL] Pass `cause` in `CannotReplaceMissingTableException` costructor
    
    ### What changes were proposed in this pull request?
    In the PR, I propose to use the `cause` argument in the 
`CannotReplaceMissingTableException` constructor.
    
    ### Why are the changes needed?
    To improve user experience with Spark SQL while troubleshooting issues. 
Currently, users don't see where the exception come from.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Manually.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #43738 from MaxGekk/fix-missed-cause.
    
    Authored-by: Max Gekk <max.g...@gmail.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 .../sql/catalyst/analysis/CannotReplaceMissingTableException.scala     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CannotReplaceMissingTableException.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CannotReplaceMissingTableException.scala
index 910bb9d3749..032cdca12c0 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CannotReplaceMissingTableException.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CannotReplaceMissingTableException.scala
@@ -28,4 +28,5 @@ class CannotReplaceMissingTableException(
   extends AnalysisException(
       errorClass = "TABLE_OR_VIEW_NOT_FOUND",
       messageParameters = Map("relationName"
-        -> quoteNameParts(tableIdentifier.namespace :+ tableIdentifier.name)))
+        -> quoteNameParts(tableIdentifier.namespace :+ tableIdentifier.name)),
+      cause = cause)


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

Reply via email to