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 2020/04/20 05:09:45 UTC
[GitHub] [spark] viirya commented on a change in pull request #27728: [SPARK-25556][SPARK-17636][SPARK-31026][SPARK-31060][SQL][test-hive1.2] Nested Column Predicate Pushdown for Parquet
viirya commented on a change in pull request #27728:
URL: https://github.com/apache/spark/pull/27728#discussion_r411096547
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
##########
@@ -652,10 +652,19 @@ object DataSourceStrategy {
*/
object PushableColumn {
def unapply(e: Expression): Option[String] = {
- def helper(e: Expression) = e match {
- case a: Attribute => Some(a.name)
+ val nestedPredicatePushdownEnabled = SQLConf.get.nestedPredicatePushdownEnabled
+ import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.MultipartIdentifierHelper
+ def helper(e: Expression): Option[Seq[String]] = e match {
+ case a: Attribute =>
+ if (nestedPredicatePushdownEnabled || !a.name.contains(".")) {
+ Some(Seq(a.name))
+ } else {
+ None
+ }
+ case s: GetStructField if nestedPredicatePushdownEnabled =>
+ helper(s.child).map(_ :+ s.childSchema(s.ordinal).name)
case _ => None
}
- helper(e)
+ helper(e).map(_.quoted)
Review comment:
I can try looking at this this week. If anyone picks it up before me, I'm also ok.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org