cloud-fan commented on code in PR #35866:
URL: https://github.com/apache/spark/pull/35866#discussion_r844768340
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasingSuite.scala:
##########
@@ -812,6 +812,40 @@ class NestedColumnAliasingSuite extends SchemaPruningTest {
val expected3 =
contact.select($"name").rebalance($"name").select($"name.first").analyze
comparePlans(optimized3, expected3)
}
+
+ test("SPARK-38530: Do not push down nested ExtractValues with other
expressions") {
+ val inputType = StructType.fromDDL(
+ "a int, b struct<c: array<int>, c2: int>")
+ val simpleStruct = StructType.fromDDL(
+ "b struct<c: struct<d: int, e: int>, c2 int>"
+ )
+ val input = LocalRelation(
+ 'id.int,
+ 'col1.array(ArrayType(inputType)))
+
+ val query = input
+ .generate(Explode('col1))
+ .select(
+ UnresolvedExtractValue(
+ UnresolvedExtractValue(
+ CaseWhen(Seq(('col.getField("a").===(1),
Review Comment:
```suggestion
CaseWhen(Seq(('col.getField("a") === 1,
```
--
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]