minyyy commented on a change in pull request #35866:
URL: https://github.com/apache/spark/pull/35866#discussion_r827531393
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasing.scala
##########
@@ -220,34 +220,41 @@ object NestedColumnAliasing {
/**
* Returns two types of expressions:
* - Root references that are individually accessed
- * - [[GetStructField]] or [[GetArrayStructFields]] on top of other
[[ExtractValue]]s
- * or special expressions.
+ * - GetStructField*(_: AttributeReference). GetStructField* means nested
GetStructField.
*/
- private def collectRootReferenceAndExtractValue(e: Expression):
Seq[Expression] = e match {
- case _: AttributeReference => Seq(e)
- case GetStructField(_: ExtractValue | _: AttributeReference, _, _) =>
Seq(e)
- case GetArrayStructFields(_: MapValues |
- _: MapKeys |
- _: ExtractValue |
- _: AttributeReference, _, _, _, _) => Seq(e)
- case es if es.children.nonEmpty =>
es.children.flatMap(collectRootReferenceAndExtractValue)
- case _ => Seq.empty
+ private def collectRootReferenceAndGetStructField(e: Expression):
Seq[Expression] = {
Review comment:
This function is only key change. Looking at the change of this function
and the added test should explain what I want to do pretty clearly.
--
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]