comphead commented on code in PR #60: URL: https://github.com/apache/datafusion-site/pull/60#discussion_r2002075851
########## content/blog/2025-03-18-parquet-pruning.md: ########## @@ -0,0 +1,111 @@ +--- +layout: post +title: Parquet pruning in DataFusion: Read Only What Matters +date: 2025-03-18 +author: Xiangpeng Hao +categories: [performance] +--- + +<!-- +{% comment %} +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to you under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +{% endcomment %} +--> + + +_Editor's Note: This blog was first published on [Xiangpeng Hao's blog]. Thanks to [InfluxData] for sponsoring this work as part of his PhD funding._ + +[Xiangpeng Hao's blog]: https://blog.xiangpeng.systems/posts/parquet-to-arrow/ +[InfluxData]: https://www.influxdata.com/ +<hr/> + +Parquet has become the industry standard for storing columnar data, and reading Parquet efficiently is crucial for query performance. + +To optimize this, DataFusion implements advanced Parquet support for effective data pruning and decoding. + +However, achieving high performance adds complexity, and this is no exception. This post provides an overview of the techniques used in DataFusion to selectively read Parquet files. + +### The pipeline +The diagram below illustrates the Parquet reading pipeline in DataFusion, highlighting how data flows through various pruning stages before being converted to Arrow format: + +<img src="/blog/images/parquet-pruning/read-parquet.jpg" alt="Parquet pruning pipeline in DataFusion" width="100%" class="img-responsive"> + + +#### Background: Parquet file structure +As shown in the figure above, each Parquet file has multiple row groups. Each row group contains a set of columns, and each column contains a set of pages. + +Pages are the smallest units of data in Parquet files and typically contain compressed and encoded values for a specific column. This hierarchical structure enables efficient columnar access and forms the foundation for the pruning techniques we'll discuss. Review Comment: would be nice if we can add a crosslink to Parquet metadata ? https://parquet.apache.org/docs/file-format/metadata/ -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org