AngersZhuuuu opened a new pull request #31727:
URL: https://github.com/apache/spark/pull/31727


   ### What changes were proposed in this pull request?
   In the PR, I propose to generate "stable" output attributes per the logical 
node of the DESCRIBE COLUMN command.
   
   
   ### Why are the changes needed?
   This fixes the issue demonstrated by the example:
   
   ```
   val tbl = "testcat.ns1.ns2.tbl"
   sql(s"CREATE TABLE $tbl (c0 INT) USING _")
   val description = sql(s"DESCRIBE TABLE $tbl c0")
   description.drop("info_name")
   ```
   
   ```
   [info]   org.apache.spark.sql.AnalysisException: Resolved attribute(s) 
info_name#74 missing from info_name#25,info_value#26 in operator !Project 
[info_name#74]. Attribute(s) with the same name appear in the operation: 
info_name. Please check if the right attribute(s) are used.;
   [info] !Project [info_name#74]
   [info] +- LocalRelation [info_name#25, info_value#26]
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   After this change user `drop()/add()` works well.
   
   ### How was this patch tested?
   Added UT
   


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

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