viirya commented on a change in pull request #33183:
URL: https://github.com/apache/spark/pull/33183#discussion_r664101976
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasingSuite.scala
##########
@@ -738,6 +738,31 @@ class NestedColumnAliasingSuite extends SchemaPruningTest {
val optimized = Optimize.execute(query)
comparePlans(optimized, query)
}
+
+ test("SPARK-35972: When replace ExtractValue we should use semanticEquals") {
Review comment:
+1
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasingSuite.scala
##########
@@ -738,6 +738,31 @@ class NestedColumnAliasingSuite extends SchemaPruningTest {
val optimized = Optimize.execute(query)
comparePlans(optimized, query)
}
+
+ test("SPARK-35972: NestedColumnAliasing should consider semantic equality") {
+ val dataType = new StructType()
+ .add(StructField("itemid", StringType))
+ .add(StructField("search_params", StructType(Seq(
+ StructField("col1", StringType),
+ StructField("col2", StringType)
+ ))))
+ val relation = LocalRelation('struct_data.struct(dataType))
+ val plan = relation
+ .repartition(100)
+ .select(
+ GetStructField('struct_data, 1, None).as("value"),
Review comment:
Yea, I see. For None case, the current `nestedFieldToAlias` cannot catch
it up.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]