dongjoon-hyun opened a new pull request #30190:
URL: https://github.com/apache/spark/pull/30190


   ### What changes were proposed in this pull request?
   
   This PR aims to wrap `ArrayBasedMapData` literal representation with 
`map(...)`.
   
   ### Why are the changes needed?
   
   Literal ArrayBasedMapData has inconsistent string representation from 
`LogicalPlan` to `Optimized Logical Plan/Physical Plan`. Also, the 
representation at `Optimized Logical Plan` and `Physical Plan` is ambiguous 
like `keys: [key1], values: [value1] AS c#0`.
   
   ```
   scala> spark.version
   res0: String = 2.4.7
   
   scala> sql("SELECT map('key1', 'value1') c").explain(true)
   == Parsed Logical Plan ==
   'Project ['map(key1, value1) AS c#0]
   +- OneRowRelation
   
   == Analyzed Logical Plan ==
   c: map<string,string>
   Project [map(key1, value1) AS c#0]
   +- OneRowRelation
   
   == Optimized Logical Plan ==
   Project [keys: [key1], values: [value1] AS c#0]
   +- OneRowRelation
   
   == Physical Plan ==
   *(1) Project [keys: [key1], values: [value1] AS c#0]
   +- Scan OneRowRelation[]
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. This changes the query plan's string representation in `explain` 
command and UI.
   
   ### How was this patch tested?
   
   Pass the CI with the newly added test case.
   


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