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

gurwls223 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 8513b91c53b2 [SPARK-52363][SQL][TESTS] Analyzer NameScope test for 
nested struct fields inside map values
8513b91c53b2 is described below

commit 8513b91c53b2fd3692f773ab540c3e6715cce3c5
Author: dengziming <dengzim...@bytedance.com>
AuthorDate: Mon Jun 2 07:56:27 2025 +0900

    [SPARK-52363][SQL][TESTS] Analyzer NameScope test for nested struct fields 
inside map values
    
    ### What changes were proposed in this pull request?
    This PR adds test coverage for resolving nested struct fields inside Map 
values which was missing in the original test suite.
    
    ### Why are the changes needed?
     The new test verifies that multi-part resolution like 
mapColumn['key'].nestedField works correctly, we already defined a field 
`col11MapWithStruct`, but we didn't test it properly.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Unneeded
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #51059 from dengziming/SPARK-52363.
    
    Authored-by: dengziming <dengzim...@bytedance.com>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 .../spark/sql/analysis/resolver/NameScopeSuite.scala    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/analysis/resolver/NameScopeSuite.scala
 
b/sql/core/src/test/scala/org/apache/spark/sql/analysis/resolver/NameScopeSuite.scala
index 5feecdb5b0a5..a937bc59b0a6 100644
--- 
a/sql/core/src/test/scala/org/apache/spark/sql/analysis/resolver/NameScopeSuite.scala
+++ 
b/sql/core/src/test/scala/org/apache/spark/sql/analysis/resolver/NameScopeSuite.scala
@@ -358,6 +358,23 @@ class NameScopeSuite extends PlanTest {
       )
     )
 
+    val matchedMapStructs = stack.resolveMultipartName(Seq("col11", "key", 
"field"))
+    assert(
+      matchedMapStructs == NameTarget(
+        candidates = Seq(
+          GetStructField(GetMapValue(col11MapWithStruct, Literal("key")), 0, 
Some("field"))),
+        aliasName = Some("field"),
+        output = Seq(
+          col8Struct,
+          col9NestedStruct,
+          col10Map,
+          col11MapWithStruct,
+          col12Array,
+          col13ArrayWithStruct
+        )
+      )
+    )
+
     var matchedArrays = stack.resolveMultipartName(Seq("col12", "element"))
     assert(
       matchedArrays == NameTarget(


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

Reply via email to