spark 是否只能从 parquet 文件中读取满足某些条件的列值?

Is spark able to read only column values satisfying some condition from parquet file?

我有密码

val count = spark.read.parquet("data.parquet").select("foo").where("foo > 3").count

我感兴趣的是 spark 是否能够以某种方式下推过滤器并仅从镶木地板文件中读取满足 where 条件的值。在这种情况下我们可以避免全扫描吗?

在这种情况下,简短的回答是肯定的,但不是所有情况。

你可以试试.explain,自己看看。

这是 Internet 上免费提供的优秀参考文档,我过去从中学到了一些东西:https://db-blog.web.cern.ch/blog/luca-canali/2017-06-diving-spark-and-parquet-workloads-example