You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/09 17:44:54 UTC
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #24599:
[SPARK-27701][SQL] Extend NestedColumnAliasing to more nested field cases
dongjoon-hyun commented on a change in pull request #24599: [SPARK-27701][SQL] Extend NestedColumnAliasing to more nested field cases
URL: https://github.com/apache/spark/pull/24599#discussion_r291844027
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasing.scala
##########
@@ -86,32 +86,39 @@ object NestedColumnAliasing {
}
/**
- * Return root references that are individually accessed as a whole, and `GetStructField`s.
+ * Return root references that are individually accessed as a whole, and `GetStructField`s
+ * or `GetArrayStructField`s which on top of other `ExtractValue`s or special expressions.
+ * Check `SelectedField` to see which expressions should be listed here.
*/
- private def collectRootReferenceAndGetStructField(e: Expression): Seq[Expression] = e match {
- case _: AttributeReference | _: GetStructField => Seq(e)
- case es if es.children.nonEmpty => es.children.flatMap(collectRootReferenceAndGetStructField)
+ private def collectRootReferenceAndExtractValue(e: Expression): Seq[Expression] = e match {
+ case _: AttributeReference |
+ GetStructField(_: ExtractValue | _: AttributeReference, _, _) |
+ GetArrayStructFields(_: MapValues |
+ _: MapKeys |
+ _: ExtractValue |
+ _: AttributeReference, _, _, _, _) => Seq(e)
Review comment:
Ur, could you split into multiple `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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org