You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by Julien Le Dem <ju...@apache.org> on 2024/08/14 23:32:17 UTC
[DISCUSS] new Parquet footer experiments
This came up in the sync today.
There are a few concurrent experiments with flatbuffers for a future
Parquet footer replacement. In itself it is fine and just wanted to
reconnect the threads here so that folks are aware of each other and can
share findings.
- Neelaksh benchmarking and experiments:
https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
- Alkis has also been experimenting and led the proposal for enabling
extending the existing footer.
https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
- Xuwei also shared that he is looking into this.
I would suggest that you all reply to this thread sharing your current
progress or ideas and a link to your respective repos for experimenting.
Best
Julien
Re: [DISCUSS] new Parquet footer experiments
Posted by Alkis Evlogimenos <al...@databricks.com.INVALID>.
Yes once https://github.com/apache/parquet-benchmark/pull/1 is merged, I
plan to pull a few of those footers in so that they can seed the project
and at the same time show how donations should be made.
On Wed, Aug 28, 2024 at 10:25 AM Antoine Pitrou <an...@python.org> wrote:
>
> I suppose you already know this, but you can use public datasets as a
> source of real-world Parquet footers.
>
> For example, the GeoParquet website lists a couple data providers:
> https://geoparquet.org/
>
> Regards
>
> Antoine.
>
>
> On Sun, 18 Aug 2024 14:20:28 +0200
> Alkis Evlogimenos
> <al...@databricks.com.INVALID>
> wrote:
> > The biggest thing about benchmarks is the data itself. This is why I
> added
> > this binary https://github.com/apache/arrow/pull/42174 to help users
> donate
> > their slow to parse footers for benchmarking purposes.
> >
> > On Sat, Aug 17, 2024 at 11:43 AM Neelaksh Singh <ne...@gmail.com>
> > wrote:
> >
> > > One more point that I would like to mention here is that we have put a
> lot
> > > of effort into REPRODUCIBILITY for this benchmark repo. There have
> been a
> > > lot of great benchmarking efforts that have been done as part of this
> > > discussion. However, one limitation is that many of the experiments
> have
> > > not included code or take a fair bit of effort to setup. We've made
> strong
> > > efforts here using Docker and vcpkg to make the setup for these
> benchmarks
> > > as transparent and reproducible as possible. Our hope is that this will
> > > provide a useful contribution for others to either reproduce many of
> the
> > > results that have been discussed or easily run their own experiments
> when
> > > trying alternatives. We hope this will help facilitate the discussion
> with
> > > easily shareable experiments.
> > >
> > > On Thu, Aug 15, 2024, 9:21 PM Alkis Evlogimenos
> > > <al...@databricks.com.invalid> wrote:
> > >
> > > > > Alkis, can you elaborate how you brought the size of Flatbuffers
> down?
> > > >
> > > > I have the internal PR rewritten in separate commits with all the
> steps.
> > > I
> > > > plan to publish it to arrow repo as soon as possible. The heavy
> things in
> > > > metadata are statistics, offsets, path_in_schema. It takes ~10 steps
> to
> > > cut
> > > > the size down, each of which takes a good chunk of the original size.
> > > >
> > > > On Thu, Aug 15, 2024 at 2:43 PM Jan Finis <
> jpfinis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > > >
> > > > > I guess most close source implementations have done these
> optimizations
> > > > > already, it has just not been done in the open source versions.
> E.g.,
> > > we
> > > > > switched to a custom-built thrift runtime using pool allocators
> and
> > > > string
> > > > > views instead of copied strings a few years ago, seeing comparable
> > > > > speed-ups. The C++ thrift library is just horribly inefficient.
> > > > >
> > > > > I agree with Alkis though that there are some gains that can be
> > > achieved
> > > > by
> > > > > optimizing, but the format has inherent drawbacks. Flatbuffers is
> > > indeed
> > > > > more efficient but at the cost of increased size.
> > > > > Alkis, can you elaborate how you brought the size of Flatbuffers
> down?
> > > > >
> > > > > Cheers,
> > > > > Jan
> > > > >
> > > > > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> > > > > andrewlamb11@gmail.com>:
> > > > >
> > > > > > I don't disagree that flatbuffers would be faster than thrift
> > > decoding
> > > > > >
> > > > > > I am trying to say that with software engineering only (no
> change to
> > > > the
> > > > > > format) it is likely possible to increase parquet thrift
> metadata
> > > > parsing
> > > > > > speed by 4x.
> > > > > >
> > > > > > This is not 25x of course, but 4x is non trivial.
> > > > > >
> > > > > > The fact that no one yet has bothered to invest the time to get
> the
> > > 4x
> > > > > yet
> > > > > > in open source implementations of parquet suggests to me that
> the
> > > > parsing
> > > > > > time may not be as critical an issue as we think
> > > > > >
> > > > > > Andrew
> > > > > >
> > > > > > On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> > > > > > <
> alkis.evlogimenos-z4fuWbJyBqLnpCJqcOk8IAuZikBJl79T@public.gmane.org>
> wrote:
> > > > > >
> > > > > > > The difference in parsing speed between thrift and flatbuffer
> is
> > > > >25x.
> > > > > > > Thrift has some fundamental design decisions that make
> decoding
> > > slow:
> > > > > > > 1. the thrift compact protocol is very data dependent: uleb
> > > encoding
> > > > > for
> > > > > > > integers, field ids are deltas from previous. The data
> dependencies
> > > > > > > disallow pipelining of modern cpus
> > > > > > > 2. object model does not have a way to use arenas to avoid
> many
> > > > > > allocations
> > > > > > > of objects
> > > > > > > If we keep thrift, we can potentially get 2 fixed, but fixing
> 1
> > > > > requires
> > > > > > > changes to the thrift serialization protocol. Such a change is
> not
> > > > > > > different from switching serialization format.
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <
> > > andrewlamb11@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > I wanted to share some work Xiangpeng Hao did at InfluxData
> this
> > > > > summer
> > > > > > > on
> > > > > > > > the current (thrift) metadata format[1].
> > > > > > > >
> > > > > > > > We found that with careful software engineering, we could
> likely
> > > > > > improve
> > > > > > > > the speed of reading existing parquet footer format by a
> factor
> > > of
> > > > 4
> > > > > or
> > > > > > > > more ([2] contains some specific ideas). While we analyzed
> the
> > > > > > > > Rust implementation, I believe a similar conclusion applies
> to
> > > > C/C++.
> > > > > > > >
> > > > > > > > I realize that there are certain features that switching to
> an
> > > > > entirely
> > > > > > > new
> > > > > > > > footer format would achieve, but the cost to adopting a new
> > > format
> > > > > > > > across the ecosystem is immense (e.g. Parquet "version 2.0"
> etc).
> > > > > > > >
> > > > > > > > It is my opinion that investing the same effort in software
> > > > > > optimization
> > > > > > > > that would be required for a new footer format would have a
> much
> > > > > bigger
> > > > > > > > impact
> > > > > > > >
> > > > > > > > Andrew
> > > > > > > >
> > > > > > > > [1]:
> > > https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > > > > > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > > > > > > >
> > > > > > > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > > > > > > <
> alkis.evlogimenos-z4fuWbJyBqLnpCJqcOk8IAuZikBJl79T@public.gmane.org>
> wrote:
> > > > > > > >
> > > > > > > > > Hi Julien.
> > > > > > > > >
> > > > > > > > > Thank you for reconnecting the threads.
> > > > > > > > >
> > > > > > > > > I have broken down my experiments in a narrative, commit
> by
> > > > commit
> > > > > on
> > > > > > > how
> > > > > > > > > we can go from flatbuffers being ~2x larger than thrift
> to
> > > being
> > > > > > > smaller
> > > > > > > > > (and at times even half) the size of thrift. This is still
> on
> > > an
> > > > > > > internal
> > > > > > > > > branch, I will resume work towards the end of this month
> to
> > > port
> > > > it
> > > > > > to
> > > > > > > > > arrow so that folks can look at the progress and share
> ideas.
> > > > > > > > >
> > > > > > > > > On the benchmarking front I need to build and share a
> binary
> > > for
> > > > > > third
> > > > > > > > > parties to donate their footers for analysis.
> > > > > > > > >
> > > > > > > > > The PR for parquet extensions has gotten a few rounds of
> > > reviews:
> > > > > > > > > https://github.com/apache/parquet-format/pull/254. I hope
> it
> > > > will
> > > > > be
> > > > > > > > > merged
> > > > > > > > > soon.
> > > > > > > > >
> > > > > > > > > I missed the sync yesterday - for some reason I didn't
> receive
> > > an
> > > > > > > > > invitation. Julien could you add me again to the invite
> list?
> > > > > > > > >
> > > > > > > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <
> > > julien@apache.org
> > > > >
> > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > This came up in the sync today.
> > > > > > > > > >
> > > > > > > > > > There are a few concurrent experiments with flatbuffers
> for a
> > > > > > future
> > > > > > > > > > Parquet footer replacement. In itself it is fine and
> just
> > > > wanted
> > > > > to
> > > > > > > > > > reconnect the threads here so that folks are aware of
> each
> > > > other
> > > > > > and
> > > > > > > > can
> > > > > > > > > > share findings.
> > > > > > > > > >
> > > > > > > > > > - Neelaksh benchmarking and experiments:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>
> > > > > > > > > >
> > > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > > > > > > >
> > > > > > > > > > - Alkis has also been experimenting and led the proposal
> for
> > > > > > enabling
> > > > > > > > > > extending the existing footer.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>
> > > > > > > > > >
> > > > > > > > > > - Xuwei also shared that he is looking into this.
> > > > > > > > > >
> > > > > > > > > > I would suggest that you all reply to this thread
> sharing
> > > your
> > > > > > > current
> > > > > > > > > > progress or ideas and a link to your respective repos
> for
> > > > > > > > experimenting.
> > > > > > > > > >
> > > > > > > > > > Best
> > > > > > > > > > Julien
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Antoine Pitrou <an...@python.org>.
I suppose you already know this, but you can use public datasets as a
source of real-world Parquet footers.
For example, the GeoParquet website lists a couple data providers:
https://geoparquet.org/
Regards
Antoine.
On Sun, 18 Aug 2024 14:20:28 +0200
Alkis Evlogimenos
<al...@databricks.com.INVALID>
wrote:
> The biggest thing about benchmarks is the data itself. This is why I added
> this binary https://github.com/apache/arrow/pull/42174 to help users donate
> their slow to parse footers for benchmarking purposes.
>
> On Sat, Aug 17, 2024 at 11:43 AM Neelaksh Singh <ne...@gmail.com>
> wrote:
>
> > One more point that I would like to mention here is that we have put a lot
> > of effort into REPRODUCIBILITY for this benchmark repo. There have been a
> > lot of great benchmarking efforts that have been done as part of this
> > discussion. However, one limitation is that many of the experiments have
> > not included code or take a fair bit of effort to setup. We've made strong
> > efforts here using Docker and vcpkg to make the setup for these benchmarks
> > as transparent and reproducible as possible. Our hope is that this will
> > provide a useful contribution for others to either reproduce many of the
> > results that have been discussed or easily run their own experiments when
> > trying alternatives. We hope this will help facilitate the discussion with
> > easily shareable experiments.
> >
> > On Thu, Aug 15, 2024, 9:21 PM Alkis Evlogimenos
> > <al...@databricks.com.invalid> wrote:
> >
> > > > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> > >
> > > I have the internal PR rewritten in separate commits with all the steps.
> > I
> > > plan to publish it to arrow repo as soon as possible. The heavy things in
> > > metadata are statistics, offsets, path_in_schema. It takes ~10 steps to
> > cut
> > > the size down, each of which takes a good chunk of the original size.
> > >
> > > On Thu, Aug 15, 2024 at 2:43 PM Jan Finis <jp...@public.gmane.org> wrote:
> > >
> > > > I guess most close source implementations have done these optimizations
> > > > already, it has just not been done in the open source versions. E.g.,
> > we
> > > > switched to a custom-built thrift runtime using pool allocators and
> > > string
> > > > views instead of copied strings a few years ago, seeing comparable
> > > > speed-ups. The C++ thrift library is just horribly inefficient.
> > > >
> > > > I agree with Alkis though that there are some gains that can be
> > achieved
> > > by
> > > > optimizing, but the format has inherent drawbacks. Flatbuffers is
> > indeed
> > > > more efficient but at the cost of increased size.
> > > > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> > > >
> > > > Cheers,
> > > > Jan
> > > >
> > > > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> > > > andrewlamb11@gmail.com>:
> > > >
> > > > > I don't disagree that flatbuffers would be faster than thrift
> > decoding
> > > > >
> > > > > I am trying to say that with software engineering only (no change to
> > > the
> > > > > format) it is likely possible to increase parquet thrift metadata
> > > parsing
> > > > > speed by 4x.
> > > > >
> > > > > This is not 25x of course, but 4x is non trivial.
> > > > >
> > > > > The fact that no one yet has bothered to invest the time to get the
> > 4x
> > > > yet
> > > > > in open source implementations of parquet suggests to me that the
> > > parsing
> > > > > time may not be as critical an issue as we think
> > > > >
> > > > > Andrew
> > > > >
> > > > > On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> > > > > <al...@public.gmane.org> wrote:
> > > > >
> > > > > > The difference in parsing speed between thrift and flatbuffer is
> > > >25x.
> > > > > > Thrift has some fundamental design decisions that make decoding
> > slow:
> > > > > > 1. the thrift compact protocol is very data dependent: uleb
> > encoding
> > > > for
> > > > > > integers, field ids are deltas from previous. The data dependencies
> > > > > > disallow pipelining of modern cpus
> > > > > > 2. object model does not have a way to use arenas to avoid many
> > > > > allocations
> > > > > > of objects
> > > > > > If we keep thrift, we can potentially get 2 fixed, but fixing 1
> > > > requires
> > > > > > changes to the thrift serialization protocol. Such a change is not
> > > > > > different from switching serialization format.
> > > > > >
> > > > > >
> > > > > > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <
> > andrewlamb11@gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > I wanted to share some work Xiangpeng Hao did at InfluxData this
> > > > summer
> > > > > > on
> > > > > > > the current (thrift) metadata format[1].
> > > > > > >
> > > > > > > We found that with careful software engineering, we could likely
> > > > > improve
> > > > > > > the speed of reading existing parquet footer format by a factor
> > of
> > > 4
> > > > or
> > > > > > > more ([2] contains some specific ideas). While we analyzed the
> > > > > > > Rust implementation, I believe a similar conclusion applies to
> > > C/C++.
> > > > > > >
> > > > > > > I realize that there are certain features that switching to an
> > > > entirely
> > > > > > new
> > > > > > > footer format would achieve, but the cost to adopting a new
> > format
> > > > > > > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> > > > > > >
> > > > > > > It is my opinion that investing the same effort in software
> > > > > optimization
> > > > > > > that would be required for a new footer format would have a much
> > > > bigger
> > > > > > > impact
> > > > > > >
> > > > > > > Andrew
> > > > > > >
> > > > > > > [1]:
> > https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > > > > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > > > > > >
> > > > > > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > > > > > <al...@public.gmane.org> wrote:
> > > > > > >
> > > > > > > > Hi Julien.
> > > > > > > >
> > > > > > > > Thank you for reconnecting the threads.
> > > > > > > >
> > > > > > > > I have broken down my experiments in a narrative, commit by
> > > commit
> > > > on
> > > > > > how
> > > > > > > > we can go from flatbuffers being ~2x larger than thrift to
> > being
> > > > > > smaller
> > > > > > > > (and at times even half) the size of thrift. This is still on
> > an
> > > > > > internal
> > > > > > > > branch, I will resume work towards the end of this month to
> > port
> > > it
> > > > > to
> > > > > > > > arrow so that folks can look at the progress and share ideas.
> > > > > > > >
> > > > > > > > On the benchmarking front I need to build and share a binary
> > for
> > > > > third
> > > > > > > > parties to donate their footers for analysis.
> > > > > > > >
> > > > > > > > The PR for parquet extensions has gotten a few rounds of
> > reviews:
> > > > > > > > https://github.com/apache/parquet-format/pull/254. I hope it
> > > will
> > > > be
> > > > > > > > merged
> > > > > > > > soon.
> > > > > > > >
> > > > > > > > I missed the sync yesterday - for some reason I didn't receive
> > an
> > > > > > > > invitation. Julien could you add me again to the invite list?
> > > > > > > >
> > > > > > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <
> > julien@apache.org
> > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > This came up in the sync today.
> > > > > > > > >
> > > > > > > > > There are a few concurrent experiments with flatbuffers for a
> > > > > future
> > > > > > > > > Parquet footer replacement. In itself it is fine and just
> > > wanted
> > > > to
> > > > > > > > > reconnect the threads here so that folks are aware of each
> > > other
> > > > > and
> > > > > > > can
> > > > > > > > > share findings.
> > > > > > > > >
> > > > > > > > > - Neelaksh benchmarking and experiments:
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > > > > > >
> > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > > > > > >
> > > > > > > > > - Alkis has also been experimenting and led the proposal for
> > > > > enabling
> > > > > > > > > extending the existing footer.
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > > > > > > >
> > > > > > > > > - Xuwei also shared that he is looking into this.
> > > > > > > > >
> > > > > > > > > I would suggest that you all reply to this thread sharing
> > your
> > > > > > current
> > > > > > > > > progress or ideas and a link to your respective repos for
> > > > > > > experimenting.
> > > > > > > > >
> > > > > > > > > Best
> > > > > > > > > Julien
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Alkis Evlogimenos <al...@databricks.com.INVALID>.
The biggest thing about benchmarks is the data itself. This is why I added
this binary https://github.com/apache/arrow/pull/42174 to help users donate
their slow to parse footers for benchmarking purposes.
On Sat, Aug 17, 2024 at 11:43 AM Neelaksh Singh <ne...@gmail.com>
wrote:
> One more point that I would like to mention here is that we have put a lot
> of effort into REPRODUCIBILITY for this benchmark repo. There have been a
> lot of great benchmarking efforts that have been done as part of this
> discussion. However, one limitation is that many of the experiments have
> not included code or take a fair bit of effort to setup. We've made strong
> efforts here using Docker and vcpkg to make the setup for these benchmarks
> as transparent and reproducible as possible. Our hope is that this will
> provide a useful contribution for others to either reproduce many of the
> results that have been discussed or easily run their own experiments when
> trying alternatives. We hope this will help facilitate the discussion with
> easily shareable experiments.
>
> On Thu, Aug 15, 2024, 9:21 PM Alkis Evlogimenos
> <al...@databricks.com.invalid> wrote:
>
> > > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> >
> > I have the internal PR rewritten in separate commits with all the steps.
> I
> > plan to publish it to arrow repo as soon as possible. The heavy things in
> > metadata are statistics, offsets, path_in_schema. It takes ~10 steps to
> cut
> > the size down, each of which takes a good chunk of the original size.
> >
> > On Thu, Aug 15, 2024 at 2:43 PM Jan Finis <jp...@gmail.com> wrote:
> >
> > > I guess most close source implementations have done these optimizations
> > > already, it has just not been done in the open source versions. E.g.,
> we
> > > switched to a custom-built thrift runtime using pool allocators and
> > string
> > > views instead of copied strings a few years ago, seeing comparable
> > > speed-ups. The C++ thrift library is just horribly inefficient.
> > >
> > > I agree with Alkis though that there are some gains that can be
> achieved
> > by
> > > optimizing, but the format has inherent drawbacks. Flatbuffers is
> indeed
> > > more efficient but at the cost of increased size.
> > > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> > >
> > > Cheers,
> > > Jan
> > >
> > > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> > > andrewlamb11@gmail.com>:
> > >
> > > > I don't disagree that flatbuffers would be faster than thrift
> decoding
> > > >
> > > > I am trying to say that with software engineering only (no change to
> > the
> > > > format) it is likely possible to increase parquet thrift metadata
> > parsing
> > > > speed by 4x.
> > > >
> > > > This is not 25x of course, but 4x is non trivial.
> > > >
> > > > The fact that no one yet has bothered to invest the time to get the
> 4x
> > > yet
> > > > in open source implementations of parquet suggests to me that the
> > parsing
> > > > time may not be as critical an issue as we think
> > > >
> > > > Andrew
> > > >
> > > > On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> > > > <al...@databricks.com.invalid> wrote:
> > > >
> > > > > The difference in parsing speed between thrift and flatbuffer is
> > >25x.
> > > > > Thrift has some fundamental design decisions that make decoding
> slow:
> > > > > 1. the thrift compact protocol is very data dependent: uleb
> encoding
> > > for
> > > > > integers, field ids are deltas from previous. The data dependencies
> > > > > disallow pipelining of modern cpus
> > > > > 2. object model does not have a way to use arenas to avoid many
> > > > allocations
> > > > > of objects
> > > > > If we keep thrift, we can potentially get 2 fixed, but fixing 1
> > > requires
> > > > > changes to the thrift serialization protocol. Such a change is not
> > > > > different from switching serialization format.
> > > > >
> > > > >
> > > > > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <
> andrewlamb11@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > I wanted to share some work Xiangpeng Hao did at InfluxData this
> > > summer
> > > > > on
> > > > > > the current (thrift) metadata format[1].
> > > > > >
> > > > > > We found that with careful software engineering, we could likely
> > > > improve
> > > > > > the speed of reading existing parquet footer format by a factor
> of
> > 4
> > > or
> > > > > > more ([2] contains some specific ideas). While we analyzed the
> > > > > > Rust implementation, I believe a similar conclusion applies to
> > C/C++.
> > > > > >
> > > > > > I realize that there are certain features that switching to an
> > > entirely
> > > > > new
> > > > > > footer format would achieve, but the cost to adopting a new
> format
> > > > > > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> > > > > >
> > > > > > It is my opinion that investing the same effort in software
> > > > optimization
> > > > > > that would be required for a new footer format would have a much
> > > bigger
> > > > > > impact
> > > > > >
> > > > > > Andrew
> > > > > >
> > > > > > [1]:
> https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > > > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > > > > >
> > > > > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > > > > <al...@databricks.com.invalid> wrote:
> > > > > >
> > > > > > > Hi Julien.
> > > > > > >
> > > > > > > Thank you for reconnecting the threads.
> > > > > > >
> > > > > > > I have broken down my experiments in a narrative, commit by
> > commit
> > > on
> > > > > how
> > > > > > > we can go from flatbuffers being ~2x larger than thrift to
> being
> > > > > smaller
> > > > > > > (and at times even half) the size of thrift. This is still on
> an
> > > > > internal
> > > > > > > branch, I will resume work towards the end of this month to
> port
> > it
> > > > to
> > > > > > > arrow so that folks can look at the progress and share ideas.
> > > > > > >
> > > > > > > On the benchmarking front I need to build and share a binary
> for
> > > > third
> > > > > > > parties to donate their footers for analysis.
> > > > > > >
> > > > > > > The PR for parquet extensions has gotten a few rounds of
> reviews:
> > > > > > > https://github.com/apache/parquet-format/pull/254. I hope it
> > will
> > > be
> > > > > > > merged
> > > > > > > soon.
> > > > > > >
> > > > > > > I missed the sync yesterday - for some reason I didn't receive
> an
> > > > > > > invitation. Julien could you add me again to the invite list?
> > > > > > >
> > > > > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <
> julien@apache.org
> > >
> > > > > wrote:
> > > > > > >
> > > > > > > > This came up in the sync today.
> > > > > > > >
> > > > > > > > There are a few concurrent experiments with flatbuffers for a
> > > > future
> > > > > > > > Parquet footer replacement. In itself it is fine and just
> > wanted
> > > to
> > > > > > > > reconnect the threads here so that folks are aware of each
> > other
> > > > and
> > > > > > can
> > > > > > > > share findings.
> > > > > > > >
> > > > > > > > - Neelaksh benchmarking and experiments:
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > > > > >
> > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > > > > >
> > > > > > > > - Alkis has also been experimenting and led the proposal for
> > > > enabling
> > > > > > > > extending the existing footer.
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > > > > > >
> > > > > > > > - Xuwei also shared that he is looking into this.
> > > > > > > >
> > > > > > > > I would suggest that you all reply to this thread sharing
> your
> > > > > current
> > > > > > > > progress or ideas and a link to your respective repos for
> > > > > > experimenting.
> > > > > > > >
> > > > > > > > Best
> > > > > > > > Julien
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Neelaksh Singh <ne...@gmail.com>.
One more point that I would like to mention here is that we have put a lot
of effort into REPRODUCIBILITY for this benchmark repo. There have been a
lot of great benchmarking efforts that have been done as part of this
discussion. However, one limitation is that many of the experiments have
not included code or take a fair bit of effort to setup. We've made strong
efforts here using Docker and vcpkg to make the setup for these benchmarks
as transparent and reproducible as possible. Our hope is that this will
provide a useful contribution for others to either reproduce many of the
results that have been discussed or easily run their own experiments when
trying alternatives. We hope this will help facilitate the discussion with
easily shareable experiments.
On Thu, Aug 15, 2024, 9:21 PM Alkis Evlogimenos
<al...@databricks.com.invalid> wrote:
> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
>
> I have the internal PR rewritten in separate commits with all the steps. I
> plan to publish it to arrow repo as soon as possible. The heavy things in
> metadata are statistics, offsets, path_in_schema. It takes ~10 steps to cut
> the size down, each of which takes a good chunk of the original size.
>
> On Thu, Aug 15, 2024 at 2:43 PM Jan Finis <jp...@gmail.com> wrote:
>
> > I guess most close source implementations have done these optimizations
> > already, it has just not been done in the open source versions. E.g., we
> > switched to a custom-built thrift runtime using pool allocators and
> string
> > views instead of copied strings a few years ago, seeing comparable
> > speed-ups. The C++ thrift library is just horribly inefficient.
> >
> > I agree with Alkis though that there are some gains that can be achieved
> by
> > optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
> > more efficient but at the cost of increased size.
> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> >
> > Cheers,
> > Jan
> >
> > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> > andrewlamb11@gmail.com>:
> >
> > > I don't disagree that flatbuffers would be faster than thrift decoding
> > >
> > > I am trying to say that with software engineering only (no change to
> the
> > > format) it is likely possible to increase parquet thrift metadata
> parsing
> > > speed by 4x.
> > >
> > > This is not 25x of course, but 4x is non trivial.
> > >
> > > The fact that no one yet has bothered to invest the time to get the 4x
> > yet
> > > in open source implementations of parquet suggests to me that the
> parsing
> > > time may not be as critical an issue as we think
> > >
> > > Andrew
> > >
> > > On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> > > <al...@databricks.com.invalid> wrote:
> > >
> > > > The difference in parsing speed between thrift and flatbuffer is
> >25x.
> > > > Thrift has some fundamental design decisions that make decoding slow:
> > > > 1. the thrift compact protocol is very data dependent: uleb encoding
> > for
> > > > integers, field ids are deltas from previous. The data dependencies
> > > > disallow pipelining of modern cpus
> > > > 2. object model does not have a way to use arenas to avoid many
> > > allocations
> > > > of objects
> > > > If we keep thrift, we can potentially get 2 fixed, but fixing 1
> > requires
> > > > changes to the thrift serialization protocol. Such a change is not
> > > > different from switching serialization format.
> > > >
> > > >
> > > > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <andrewlamb11@gmail.com
> >
> > > > wrote:
> > > >
> > > > > I wanted to share some work Xiangpeng Hao did at InfluxData this
> > summer
> > > > on
> > > > > the current (thrift) metadata format[1].
> > > > >
> > > > > We found that with careful software engineering, we could likely
> > > improve
> > > > > the speed of reading existing parquet footer format by a factor of
> 4
> > or
> > > > > more ([2] contains some specific ideas). While we analyzed the
> > > > > Rust implementation, I believe a similar conclusion applies to
> C/C++.
> > > > >
> > > > > I realize that there are certain features that switching to an
> > entirely
> > > > new
> > > > > footer format would achieve, but the cost to adopting a new format
> > > > > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> > > > >
> > > > > It is my opinion that investing the same effort in software
> > > optimization
> > > > > that would be required for a new footer format would have a much
> > bigger
> > > > > impact
> > > > >
> > > > > Andrew
> > > > >
> > > > > [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > > > >
> > > > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > > > <al...@databricks.com.invalid> wrote:
> > > > >
> > > > > > Hi Julien.
> > > > > >
> > > > > > Thank you for reconnecting the threads.
> > > > > >
> > > > > > I have broken down my experiments in a narrative, commit by
> commit
> > on
> > > > how
> > > > > > we can go from flatbuffers being ~2x larger than thrift to being
> > > > smaller
> > > > > > (and at times even half) the size of thrift. This is still on an
> > > > internal
> > > > > > branch, I will resume work towards the end of this month to port
> it
> > > to
> > > > > > arrow so that folks can look at the progress and share ideas.
> > > > > >
> > > > > > On the benchmarking front I need to build and share a binary for
> > > third
> > > > > > parties to donate their footers for analysis.
> > > > > >
> > > > > > The PR for parquet extensions has gotten a few rounds of reviews:
> > > > > > https://github.com/apache/parquet-format/pull/254. I hope it
> will
> > be
> > > > > > merged
> > > > > > soon.
> > > > > >
> > > > > > I missed the sync yesterday - for some reason I didn't receive an
> > > > > > invitation. Julien could you add me again to the invite list?
> > > > > >
> > > > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <julien@apache.org
> >
> > > > wrote:
> > > > > >
> > > > > > > This came up in the sync today.
> > > > > > >
> > > > > > > There are a few concurrent experiments with flatbuffers for a
> > > future
> > > > > > > Parquet footer replacement. In itself it is fine and just
> wanted
> > to
> > > > > > > reconnect the threads here so that folks are aware of each
> other
> > > and
> > > > > can
> > > > > > > share findings.
> > > > > > >
> > > > > > > - Neelaksh benchmarking and experiments:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > > > >
> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > > > >
> > > > > > > - Alkis has also been experimenting and led the proposal for
> > > enabling
> > > > > > > extending the existing footer.
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > > > > >
> > > > > > > - Xuwei also shared that he is looking into this.
> > > > > > >
> > > > > > > I would suggest that you all reply to this thread sharing your
> > > > current
> > > > > > > progress or ideas and a link to your respective repos for
> > > > > experimenting.
> > > > > > >
> > > > > > > Best
> > > > > > > Julien
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Alkis Evlogimenos <al...@databricks.com.INVALID>.
> Alkis, can you elaborate how you brought the size of Flatbuffers down?
I have the internal PR rewritten in separate commits with all the steps. I
plan to publish it to arrow repo as soon as possible. The heavy things in
metadata are statistics, offsets, path_in_schema. It takes ~10 steps to cut
the size down, each of which takes a good chunk of the original size.
On Thu, Aug 15, 2024 at 2:43 PM Jan Finis <jp...@gmail.com> wrote:
> I guess most close source implementations have done these optimizations
> already, it has just not been done in the open source versions. E.g., we
> switched to a custom-built thrift runtime using pool allocators and string
> views instead of copied strings a few years ago, seeing comparable
> speed-ups. The C++ thrift library is just horribly inefficient.
>
> I agree with Alkis though that there are some gains that can be achieved by
> optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
> more efficient but at the cost of increased size.
> Alkis, can you elaborate how you brought the size of Flatbuffers down?
>
> Cheers,
> Jan
>
> Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> andrewlamb11@gmail.com>:
>
> > I don't disagree that flatbuffers would be faster than thrift decoding
> >
> > I am trying to say that with software engineering only (no change to the
> > format) it is likely possible to increase parquet thrift metadata parsing
> > speed by 4x.
> >
> > This is not 25x of course, but 4x is non trivial.
> >
> > The fact that no one yet has bothered to invest the time to get the 4x
> yet
> > in open source implementations of parquet suggests to me that the parsing
> > time may not be as critical an issue as we think
> >
> > Andrew
> >
> > On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> > <al...@databricks.com.invalid> wrote:
> >
> > > The difference in parsing speed between thrift and flatbuffer is >25x.
> > > Thrift has some fundamental design decisions that make decoding slow:
> > > 1. the thrift compact protocol is very data dependent: uleb encoding
> for
> > > integers, field ids are deltas from previous. The data dependencies
> > > disallow pipelining of modern cpus
> > > 2. object model does not have a way to use arenas to avoid many
> > allocations
> > > of objects
> > > If we keep thrift, we can potentially get 2 fixed, but fixing 1
> requires
> > > changes to the thrift serialization protocol. Such a change is not
> > > different from switching serialization format.
> > >
> > >
> > > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
> > > wrote:
> > >
> > > > I wanted to share some work Xiangpeng Hao did at InfluxData this
> summer
> > > on
> > > > the current (thrift) metadata format[1].
> > > >
> > > > We found that with careful software engineering, we could likely
> > improve
> > > > the speed of reading existing parquet footer format by a factor of 4
> or
> > > > more ([2] contains some specific ideas). While we analyzed the
> > > > Rust implementation, I believe a similar conclusion applies to C/C++.
> > > >
> > > > I realize that there are certain features that switching to an
> entirely
> > > new
> > > > footer format would achieve, but the cost to adopting a new format
> > > > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> > > >
> > > > It is my opinion that investing the same effort in software
> > optimization
> > > > that would be required for a new footer format would have a much
> bigger
> > > > impact
> > > >
> > > > Andrew
> > > >
> > > > [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > > >
> > > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > > <al...@databricks.com.invalid> wrote:
> > > >
> > > > > Hi Julien.
> > > > >
> > > > > Thank you for reconnecting the threads.
> > > > >
> > > > > I have broken down my experiments in a narrative, commit by commit
> on
> > > how
> > > > > we can go from flatbuffers being ~2x larger than thrift to being
> > > smaller
> > > > > (and at times even half) the size of thrift. This is still on an
> > > internal
> > > > > branch, I will resume work towards the end of this month to port it
> > to
> > > > > arrow so that folks can look at the progress and share ideas.
> > > > >
> > > > > On the benchmarking front I need to build and share a binary for
> > third
> > > > > parties to donate their footers for analysis.
> > > > >
> > > > > The PR for parquet extensions has gotten a few rounds of reviews:
> > > > > https://github.com/apache/parquet-format/pull/254. I hope it will
> be
> > > > > merged
> > > > > soon.
> > > > >
> > > > > I missed the sync yesterday - for some reason I didn't receive an
> > > > > invitation. Julien could you add me again to the invite list?
> > > > >
> > > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
> > > wrote:
> > > > >
> > > > > > This came up in the sync today.
> > > > > >
> > > > > > There are a few concurrent experiments with flatbuffers for a
> > future
> > > > > > Parquet footer replacement. In itself it is fine and just wanted
> to
> > > > > > reconnect the threads here so that folks are aware of each other
> > and
> > > > can
> > > > > > share findings.
> > > > > >
> > > > > > - Neelaksh benchmarking and experiments:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > > >
> > > > > > - Alkis has also been experimenting and led the proposal for
> > enabling
> > > > > > extending the existing footer.
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > > > >
> > > > > > - Xuwei also shared that he is looking into this.
> > > > > >
> > > > > > I would suggest that you all reply to this thread sharing your
> > > current
> > > > > > progress or ideas and a link to your respective repos for
> > > > experimenting.
> > > > > >
> > > > > > Best
> > > > > > Julien
> > > > > >
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Jan Finis <jp...@gmail.com>.
>
> Also, my intuition is that the investment to migrate Parquet to
> Flatbuffers should actually be smaller than the investment to fully
> support something like delta encodings in Arrow (without on-the-fly
> decoding to the equivalent of PLAIN).
>
Fully agree on this.
Right, but in a world dominated by networked, commodity object storage,
> perhaps optimising for efficient transport and decode might be right,
> and storage efficiency perhaps less important... I think it was the
> btrblocks paper that came to much the same conclusion.
>
Yes, fast decompression speed is important too, but high compression ratios
still matter. In a perfect world, you would want both at the same time.
Btrblocks also compresses heavily, it is far away from Arrow. Also note
that storage cost is still a thing. With immutable formats like Iceberg and
DeltaLake that store even already deleted data of older versions, you rack
up a lot of data.
We probably have exabytes of data lying around. It does make a difference
to your object store bill
whether you store 1 or 3 exabytes...
Cheers
Jan
Am Do., 22. Aug. 2024 um 14:54 Uhr schrieb Antoine Pitrou <
antoine@python.org>:
> On Thu, 22 Aug 2024 10:08:00 +0100
> Raphael Taylor-Davies
> <r....@googlemail.com.INVALID>
> wrote:
> > Right, but in a world dominated by networked, commodity object storage,
> > perhaps optimising for efficient transport and decode might be right,
> > and storage efficiency perhaps less important... I think it was the
> > btrblocks paper that came to much the same conclusion.
>
> "Efficient transport" means different things in different situations.
> On a very high-speed local network, Arrow IPC may shine. When
> transferring data between a datacenter (say over S3) and an analyst or
> scientist's workstation or laptop, Parquet should really help make the
> transmission faster (and perhaps less expensive in $ terms).
>
> > Anyway my broader point was that the underlying motivation for a lot of
> > this discussion appears to be a desire to make parquet better at
> > workloads it currently struggles with. Metadata is but a part of this,
> > but insufficient for many of the workloads discussed. When one also
> > considers the additional functionality required, e.g. fixed size lists,
> > efficient random-access reads, SIMD-friendly encodings, more
> > expressive/extension types, etc... I start to wonder... If feather added
> > one of the modern delta encodings, I think it would be almost perfect...
>
> There are a lot of dimensions in the domain space, and I'm skeptical
> that simply adding delta encodings to the Arrow in-memory format would
> really close the gap with Parquet, given that the latter has other
> sophisticated encodings, and richer metadata including statistics, page
> indices and optional bloom filters.
>
> Also, my intuition is that the investment to migrate Parquet to
> Flatbuffers should actually be smaller than the investment to fully
> support something like delta encodings in Arrow (without on-the-fly
> decoding to the equivalent of PLAIN).
>
> Regards
>
> Antoine.
>
>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Jan Finis <jp...@gmail.com>.
>
> Also, my intuition is that the investment to migrate Parquet to
> Flatbuffers should actually be smaller than the investment to fully
> support something like delta encodings in Arrow (without on-the-fly
> decoding to the equivalent of PLAIN).
>
Fully agree on this.
Right, but in a world dominated by networked, commodity object storage,
> perhaps optimising for efficient transport and decode might be right,
> and storage efficiency perhaps less important... I think it was the
> btrblocks paper that came to much the same conclusion.
>
Yes, fast decompression speed is important too, but high compression ratios
still matter. In a perfect world, you would want both at the same time.
Btrblocks also compresses heavily, it is far away from Arrow. Also note
that storage cost is still a thing. With immutable formats like Iceberg and
DeltaLake that store even already deleted data of older versions, you rack
up a lot of data.
We probably have exabytes of data lying around. It does make a difference
to your object store bill
whether you store 1 or 3 exabytes...
Cheers
Jan
Am Do., 22. Aug. 2024 um 14:54 Uhr schrieb Antoine Pitrou <
antoine@python.org>:
> On Thu, 22 Aug 2024 10:08:00 +0100
> Raphael Taylor-Davies
> <r....@googlemail.com.INVALID>
> wrote:
> > Right, but in a world dominated by networked, commodity object storage,
> > perhaps optimising for efficient transport and decode might be right,
> > and storage efficiency perhaps less important... I think it was the
> > btrblocks paper that came to much the same conclusion.
>
> "Efficient transport" means different things in different situations.
> On a very high-speed local network, Arrow IPC may shine. When
> transferring data between a datacenter (say over S3) and an analyst or
> scientist's workstation or laptop, Parquet should really help make the
> transmission faster (and perhaps less expensive in $ terms).
>
> > Anyway my broader point was that the underlying motivation for a lot of
> > this discussion appears to be a desire to make parquet better at
> > workloads it currently struggles with. Metadata is but a part of this,
> > but insufficient for many of the workloads discussed. When one also
> > considers the additional functionality required, e.g. fixed size lists,
> > efficient random-access reads, SIMD-friendly encodings, more
> > expressive/extension types, etc... I start to wonder... If feather added
> > one of the modern delta encodings, I think it would be almost perfect...
>
> There are a lot of dimensions in the domain space, and I'm skeptical
> that simply adding delta encodings to the Arrow in-memory format would
> really close the gap with Parquet, given that the latter has other
> sophisticated encodings, and richer metadata including statistics, page
> indices and optional bloom filters.
>
> Also, my intuition is that the investment to migrate Parquet to
> Flatbuffers should actually be smaller than the investment to fully
> support something like delta encodings in Arrow (without on-the-fly
> decoding to the equivalent of PLAIN).
>
> Regards
>
> Antoine.
>
>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Antoine Pitrou <an...@python.org>.
On Thu, 22 Aug 2024 10:08:00 +0100
Raphael Taylor-Davies
<r....@googlemail.com.INVALID>
wrote:
> Right, but in a world dominated by networked, commodity object storage,
> perhaps optimising for efficient transport and decode might be right,
> and storage efficiency perhaps less important... I think it was the
> btrblocks paper that came to much the same conclusion.
"Efficient transport" means different things in different situations.
On a very high-speed local network, Arrow IPC may shine. When
transferring data between a datacenter (say over S3) and an analyst or
scientist's workstation or laptop, Parquet should really help make the
transmission faster (and perhaps less expensive in $ terms).
> Anyway my broader point was that the underlying motivation for a lot of
> this discussion appears to be a desire to make parquet better at
> workloads it currently struggles with. Metadata is but a part of this,
> but insufficient for many of the workloads discussed. When one also
> considers the additional functionality required, e.g. fixed size lists,
> efficient random-access reads, SIMD-friendly encodings, more
> expressive/extension types, etc... I start to wonder... If feather added
> one of the modern delta encodings, I think it would be almost perfect...
There are a lot of dimensions in the domain space, and I'm skeptical
that simply adding delta encodings to the Arrow in-memory format would
really close the gap with Parquet, given that the latter has other
sophisticated encodings, and richer metadata including statistics, page
indices and optional bloom filters.
Also, my intuition is that the investment to migrate Parquet to
Flatbuffers should actually be smaller than the investment to fully
support something like delta encodings in Arrow (without on-the-fly
decoding to the equivalent of PLAIN).
Regards
Antoine.
Re: [DISCUSS] new Parquet footer experiments
Posted by Raphael Taylor-Davies <r....@googlemail.com.INVALID>.
Right, but in a world dominated by networked, commodity object storage,
perhaps optimising for efficient transport and decode might be right,
and storage efficiency perhaps less important... I think it was the
btrblocks paper that came to much the same conclusion.
Anyway my broader point was that the underlying motivation for a lot of
this discussion appears to be a desire to make parquet better at
workloads it currently struggles with. Metadata is but a part of this,
but insufficient for many of the workloads discussed. When one also
considers the additional functionality required, e.g. fixed size lists,
efficient random-access reads, SIMD-friendly encodings, more
expressive/extension types, etc... I start to wonder... If feather added
one of the modern delta encodings, I think it would be almost perfect...
Kind Regards,
Raphael
On 22/08/2024 09:09, Antoine Pitrou wrote:
> As a Apache Arrow developer myself, I find the analogy with Feather to
> be flawed.
>
> Feather (or, rather, Arrow IPC) is a vastly different format than
> Parquet. It is useful primarily for transport (e.g. over the network,
> using Arrow Flight RPC for example) or short-term storage (a
> spillover cache of temporary data perhaps?). For more persistent
> storage Parquet has a lot of qualities that are unmatched by Arrow IPC,
> primarily in the size optimization department. Arrow IPC is really
> a off-RAM materialization of the Arrow in-memory format, with
> a little additional metadata to describe the schema.
>
> But unlike Parquet vs. Arrow IPC, I don't think Thrift has many
> qualities that would make it better than Flatbuffers for Parquet
> metadata.
>
> The main concern that may be useful to watch for is binary size of the
> encoded metadata (and whether than can be alleviated using a simple and
> fast compression algorithm, e.g. LZ4).
>
> Regards
>
> Antoine.
>
>
>
> On Thu, 15 Aug 2024 15:27:13 +0100
> Raphael Taylor-Davies
> <r....@googlemail.com.INVALID>
> wrote:
>> Right, I'm not disputing that parquet has a lot of additional functionality that people could leverage compared to feather. However, many of the use-cases that have been articulated to justify switching parquet to flatbuffers don't benefit from many of these features. For example, ML workloads often exhibit some combination of random access, fixed length lists, no statistics or indexes, and sourcing data from fast NVMe storage that is bottlenecked by more expensive encodings. Similarly many others are making use of indexes maintained outside the files, obviating the need for indexes and statistics within the files themselves.
>>
>> As I stated, feather is not without flaws, but it seems wise to assess which is closer to the desired feature set, rather than dismissing one out of hand because its total feature set is smaller. This does of course entail articulating what this feature set actually is, which may actually be the core of my question...
>>
>> On 15 August 2024 14:50:08 BST, Jan Finis <jp...@gmail.com> wrote:
>>> (I don't want to come over as not liking Arrow; quite the opposite is the
>>> case, it's amazing for IPC and we also use it for that. And I do think we
>>> can and should learn from Arrow and there is a lot of things that would
>>> make sense to adopt or at least to get closer too, e.g., its type system.)
>>>
>>> Am Do., 15. Aug. 2024 um 15:46 Uhr schrieb Jan Finis <jp...@gmail.com>:
>>>
>>>> I
>>>>> wonder if there might be mileage in building off an existing format
>>>>> instead of defining another flatbuffer based tabular encoding
>>>>>
>>>> We *are* building off an existing format. Parquet will stay as it is, its
>>>> logical structure and everything. The encoding used for this logical
>>>> structure's metadata is just a detail. In contrast, Arrow (Feather) is
>>>> missing so many things that Parquet has, so you would need a lot more work
>>>> to get to where Parquet is, if you started off with Arrow.
>>>>
>>>> I also wonder if, for example, feather added better encoding
>>>>> support, we would get something that met all the requirements, without
>>>>> needing to effectively create a third file format?
>>>>
>>>> I would argue that feather is faaaaar farther away from being a good
>>>> storage format than Parquet is. Yes, you could add a lot of stuff to
>>>> feather to make it a great storage format, but it would be way more than
>>>> you would need to add to Parquet to make it as good. And you would also be
>>>> creating de facto a third format if you change that much. That's also why
>>>> Feather has little adoption: It's not a good storage format as of now, as
>>>> its based on Arrow and Arrow isn't design for that.
>>>>
>>>> One thing that occurs to me from reading a number of the proposals /
>>>>> investigations in this space is how similar many of them end up looking
>>>>> to Apache Arrow Feather / IPC.
>>>>
>>>> I would argue that Parquet and Arrow are actually not that similar. They
>>>> are similar, but only "trivially so" (i.e., in ways in which each storage
>>>> format would end up at a roughly similar design):
>>>>
>>>> Obvious similarities:
>>>> * Most modern formats are chunked columnar, as this is just obviously a
>>>> good idea for many scenarios, as you can choose to skip columns and
>>>> chunking helps with being able to write without having to buffer all the
>>>> file before writing it. In that regard Parquet and Arrow are similar, but
>>>> so are ORC and others.
>>>> * Formats have some kind of metadata structure describing the file. In
>>>> that regard, Parquet and Arrow and all others are similar, but every format
>>>> needs this, so the similarity is trivial.
>>>> * Both have encodings. Again, any format needs this. Also the fact that
>>>> there is overlap in the encodings is just because some encodings are an
>>>> obviously good idea (e.g., dictionary).
>>>> * Both have a footer. Any format that wants to be able to be written in a
>>>> streaming fashion needs this, you don't know the metadata of the file yet
>>>> when you start writing, so you cannot use a header and putting the metadata
>>>> somewhere in the middle would make it hard to discover.
>>>>
>>>> Now, the metadata structure needs to be encoded, somehow. For this, modern
>>>> formats use encoding standards like thrift or flatbuffers. But I would
>>>> argue that the actual encoding of the metadata is *not* what defines a
>>>> format, at all; it is just a means to encode the logical structure, and
>>>> while this structure has some resemblance between Arrow and Parquet, there
>>>> are actually a lot of differences. Each format somehow has to do it and
>>>> just because two formats may decide to use the same encoding (e.g.,
>>>> flatbuffers) that doesn't make them very similar.
>>>>
>>>> But here is the greatest dissimilarity:
>>>> Arrow was made to be an IPC streaming format. As such, it needs to be very
>>>> fast to read and write. Then the python guys came and invented feather to
>>>> make the whole thing also work somewhat as a storage format, but all they
>>>> did was basically add a footer; the format itself (i.e., the encodings) are
>>>> not at all optimized for a storage format. A storage format may / should
>>>> use more heavyweight encodings and it is okay if it is more costly to
>>>> write, as you expect it to be read multiple times while an IPC format is
>>>> usually only read once.
>>>>
>>>> Could Arrow become more of a storage format by adding more heavyweight
>>>> encodings, statistics, and indexes? It sure could! And maybe it will, but
>>>> that's not what it was designed for, so I doubt that such things will be a
>>>> high priority for Arrow. But I wouldn't - at least as of now - want to base
>>>> a storage format on Arrow. There is just too much missing. A lot of things
>>>> that Parquet has that Arrow hasn't (all the statistics, bloom filters,
>>>> indexes, etc.). It may look like Parquet is becoming Arrow if it adopts
>>>> flatbuffers as a metadata format, but I would argue that is not at all the
>>>> case. The metadata encoding is just a tiny detail and a lot of other things
>>>> are what makes Parquet Parquet.
>>>>
>>>> Cheers,
>>>> Jan
>>>>
>>>>
>>>>
>>>>
>>>> Am Do., 15. Aug. 2024 um 15:20 Uhr schrieb Raphael Taylor-Davies
>>>> <r....@googlemail.com.invalid>:
>>>>
>>>>> Hi,
>>>>>
>>>>> One thing that occurs to me from reading a number of the proposals /
>>>>> investigations in this space is how similar many of them end up looking
>>>>> to Apache Arrow Feather / IPC. Parquet does have a narrower type system
>>>>> and broader encoding and statistics support, but as far as the
>>>>> underlying file structure is concerned feather looks a lot like many of
>>>>> the parquet v3 proposals.
>>>>>
>>>>> Despite this feather has not seen especially broad adoption as far as I
>>>>> am aware, and I therefore wonder if there might be relevant learnings
>>>>> here? I also wonder if, for example, feather added better encoding
>>>>> support, we would get something that met all the requirements, without
>>>>> needing to effectively create a third file format?
>>>>>
>>>>> To be clear I have no particular affection for feather, in fact I find
>>>>> the way it handles dictionaries to be especially distasteful, but I
>>>>> wonder if there might be mileage in building off an existing format
>>>>> instead of defining another flatbuffer based tabular encoding...
>>>>>
>>>>> Kind Regards,
>>>>>
>>>>> Raphael
>>>>>
>>>>> On 15/08/2024 13:41, Jan Finis wrote:
>>>>>> I guess most close source implementations have done these optimizations
>>>>>> already, it has just not been done in the open source versions. E.g., we
>>>>>> switched to a custom-built thrift runtime using pool allocators and
>>>>> string
>>>>>> views instead of copied strings a few years ago, seeing comparable
>>>>>> speed-ups. The C++ thrift library is just horribly inefficient.
>>>>>>
>>>>>> I agree with Alkis though that there are some gains that can be
>>>>> achieved by
>>>>>> optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
>>>>>> more efficient but at the cost of increased size.
>>>>>> Alkis, can you elaborate how you brought the size of Flatbuffers down?
>>>>>>
>>>>>> Cheers,
>>>>>> Jan
>>>>>>
>>>>>> Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
>>>>>> andrewlamb11@gmail.com>:
>>>>>>
>>>>>>> I don't disagree that flatbuffers would be faster than thrift decoding
>>>>>>>
>>>>>>> I am trying to say that with software engineering only (no change to
>>>>> the
>>>>>>> format) it is likely possible to increase parquet thrift metadata
>>>>> parsing
>>>>>>> speed by 4x.
>>>>>>>
>>>>>>> This is not 25x of course, but 4x is non trivial.
>>>>>>>
>>>>>>> The fact that no one yet has bothered to invest the time to get the 4x
>>>>> yet
>>>>>>> in open source implementations of parquet suggests to me that the
>>>>> parsing
>>>>>>> time may not be as critical an issue as we think
>>>>>>>
>>>>>>> Andrew
>>>>>>>
>>>>>>> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
>>>>>>> <al...@databricks.com.invalid> wrote:
>>>>>>>
>>>>>>>> The difference in parsing speed between thrift and flatbuffer is >25x.
>>>>>>>> Thrift has some fundamental design decisions that make decoding slow:
>>>>>>>> 1. the thrift compact protocol is very data dependent: uleb encoding
>>>>> for
>>>>>>>> integers, field ids are deltas from previous. The data dependencies
>>>>>>>> disallow pipelining of modern cpus
>>>>>>>> 2. object model does not have a way to use arenas to avoid many
>>>>>>> allocations
>>>>>>>> of objects
>>>>>>>> If we keep thrift, we can potentially get 2 fixed, but fixing 1
>>>>> requires
>>>>>>>> changes to the thrift serialization protocol. Such a change is not
>>>>>>>> different from switching serialization format.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I wanted to share some work Xiangpeng Hao did at InfluxData this
>>>>> summer
>>>>>>>> on
>>>>>>>>> the current (thrift) metadata format[1].
>>>>>>>>>
>>>>>>>>> We found that with careful software engineering, we could likely
>>>>>>> improve
>>>>>>>>> the speed of reading existing parquet footer format by a factor of 4
>>>>> or
>>>>>>>>> more ([2] contains some specific ideas). While we analyzed the
>>>>>>>>> Rust implementation, I believe a similar conclusion applies to C/C++.
>>>>>>>>>
>>>>>>>>> I realize that there are certain features that switching to an
>>>>> entirely
>>>>>>>> new
>>>>>>>>> footer format would achieve, but the cost to adopting a new format
>>>>>>>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
>>>>>>>>>
>>>>>>>>> It is my opinion that investing the same effort in software
>>>>>>> optimization
>>>>>>>>> that would be required for a new footer format would have a much
>>>>> bigger
>>>>>>>>> impact
>>>>>>>>>
>>>>>>>>> Andrew
>>>>>>>>>
>>>>>>>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
>>>>>>>>> [2]: https://github.com/apache/arrow-rs/issues/5853
>>>>>>>>>
>>>>>>>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
>>>>>>>>> <al...@databricks.com.invalid> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Julien.
>>>>>>>>>>
>>>>>>>>>> Thank you for reconnecting the threads.
>>>>>>>>>>
>>>>>>>>>> I have broken down my experiments in a narrative, commit by commit
>>>>> on
>>>>>>>> how
>>>>>>>>>> we can go from flatbuffers being ~2x larger than thrift to being
>>>>>>>> smaller
>>>>>>>>>> (and at times even half) the size of thrift. This is still on an
>>>>>>>> internal
>>>>>>>>>> branch, I will resume work towards the end of this month to port it
>>>>>>> to
>>>>>>>>>> arrow so that folks can look at the progress and share ideas.
>>>>>>>>>>
>>>>>>>>>> On the benchmarking front I need to build and share a binary for
>>>>>>> third
>>>>>>>>>> parties to donate their footers for analysis.
>>>>>>>>>>
>>>>>>>>>> The PR for parquet extensions has gotten a few rounds of reviews:
>>>>>>>>>> https://github.com/apache/parquet-format/pull/254. I hope it will
>>>>> be
>>>>>>>>>> merged
>>>>>>>>>> soon.
>>>>>>>>>>
>>>>>>>>>> I missed the sync yesterday - for some reason I didn't receive an
>>>>>>>>>> invitation. Julien could you add me again to the invite list?
>>>>>>>>>>
>>>>>>>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
>>>>>>>> wrote:
>>>>>>>>>>> This came up in the sync today.
>>>>>>>>>>>
>>>>>>>>>>> There are a few concurrent experiments with flatbuffers for a
>>>>>>> future
>>>>>>>>>>> Parquet footer replacement. In itself it is fine and just wanted to
>>>>>>>>>>> reconnect the threads here so that folks are aware of each other
>>>>>>> and
>>>>>>>>> can
>>>>>>>>>>> share findings.
>>>>>>>>>>>
>>>>>>>>>>> - Neelaksh benchmarking and experiments:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>
>>>>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>>>>>>>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>>>>>>>>>>>
>>>>>>>>>>> - Alkis has also been experimenting and led the proposal for
>>>>>>> enabling
>>>>>>>>>>> extending the existing footer.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>
>>>>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>>>>>>>>>>> - Xuwei also shared that he is looking into this.
>>>>>>>>>>>
>>>>>>>>>>> I would suggest that you all reply to this thread sharing your
>>>>>>>> current
>>>>>>>>>>> progress or ideas and a link to your respective repos for
>>>>>>>>> experimenting.
>>>>>>>>>>> Best
>>>>>>>>>>> Julien
>>>>>>>>>>>
>>>>>
>>>>
>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Antoine Pitrou <an...@python.org>.
As a Apache Arrow developer myself, I find the analogy with Feather to
be flawed.
Feather (or, rather, Arrow IPC) is a vastly different format than
Parquet. It is useful primarily for transport (e.g. over the network,
using Arrow Flight RPC for example) or short-term storage (a
spillover cache of temporary data perhaps?). For more persistent
storage Parquet has a lot of qualities that are unmatched by Arrow IPC,
primarily in the size optimization department. Arrow IPC is really
a off-RAM materialization of the Arrow in-memory format, with
a little additional metadata to describe the schema.
But unlike Parquet vs. Arrow IPC, I don't think Thrift has many
qualities that would make it better than Flatbuffers for Parquet
metadata.
The main concern that may be useful to watch for is binary size of the
encoded metadata (and whether than can be alleviated using a simple and
fast compression algorithm, e.g. LZ4).
Regards
Antoine.
On Thu, 15 Aug 2024 15:27:13 +0100
Raphael Taylor-Davies
<r....@googlemail.com.INVALID>
wrote:
> Right, I'm not disputing that parquet has a lot of additional functionality that people could leverage compared to feather. However, many of the use-cases that have been articulated to justify switching parquet to flatbuffers don't benefit from many of these features. For example, ML workloads often exhibit some combination of random access, fixed length lists, no statistics or indexes, and sourcing data from fast NVMe storage that is bottlenecked by more expensive encodings. Similarly many others are making use of indexes maintained outside the files, obviating the need for indexes and statistics within the files themselves.
>
> As I stated, feather is not without flaws, but it seems wise to assess which is closer to the desired feature set, rather than dismissing one out of hand because its total feature set is smaller. This does of course entail articulating what this feature set actually is, which may actually be the core of my question...
>
> On 15 August 2024 14:50:08 BST, Jan Finis <jp...@gmail.com> wrote:
> >(I don't want to come over as not liking Arrow; quite the opposite is the
> >case, it's amazing for IPC and we also use it for that. And I do think we
> >can and should learn from Arrow and there is a lot of things that would
> >make sense to adopt or at least to get closer too, e.g., its type system.)
> >
> >Am Do., 15. Aug. 2024 um 15:46 Uhr schrieb Jan Finis <jp...@gmail.com>:
> >
> >> I
> >>> wonder if there might be mileage in building off an existing format
> >>> instead of defining another flatbuffer based tabular encoding
> >>>
> >>
> >> We *are* building off an existing format. Parquet will stay as it is, its
> >> logical structure and everything. The encoding used for this logical
> >> structure's metadata is just a detail. In contrast, Arrow (Feather) is
> >> missing so many things that Parquet has, so you would need a lot more work
> >> to get to where Parquet is, if you started off with Arrow.
> >>
> >> I also wonder if, for example, feather added better encoding
> >>> support, we would get something that met all the requirements, without
> >>> needing to effectively create a third file format?
> >>
> >>
> >> I would argue that feather is faaaaar farther away from being a good
> >> storage format than Parquet is. Yes, you could add a lot of stuff to
> >> feather to make it a great storage format, but it would be way more than
> >> you would need to add to Parquet to make it as good. And you would also be
> >> creating de facto a third format if you change that much. That's also why
> >> Feather has little adoption: It's not a good storage format as of now, as
> >> its based on Arrow and Arrow isn't design for that.
> >>
> >> One thing that occurs to me from reading a number of the proposals /
> >>> investigations in this space is how similar many of them end up looking
> >>> to Apache Arrow Feather / IPC.
> >>
> >>
> >> I would argue that Parquet and Arrow are actually not that similar. They
> >> are similar, but only "trivially so" (i.e., in ways in which each storage
> >> format would end up at a roughly similar design):
> >>
> >> Obvious similarities:
> >> * Most modern formats are chunked columnar, as this is just obviously a
> >> good idea for many scenarios, as you can choose to skip columns and
> >> chunking helps with being able to write without having to buffer all the
> >> file before writing it. In that regard Parquet and Arrow are similar, but
> >> so are ORC and others.
> >> * Formats have some kind of metadata structure describing the file. In
> >> that regard, Parquet and Arrow and all others are similar, but every format
> >> needs this, so the similarity is trivial.
> >> * Both have encodings. Again, any format needs this. Also the fact that
> >> there is overlap in the encodings is just because some encodings are an
> >> obviously good idea (e.g., dictionary).
> >> * Both have a footer. Any format that wants to be able to be written in a
> >> streaming fashion needs this, you don't know the metadata of the file yet
> >> when you start writing, so you cannot use a header and putting the metadata
> >> somewhere in the middle would make it hard to discover.
> >>
> >> Now, the metadata structure needs to be encoded, somehow. For this, modern
> >> formats use encoding standards like thrift or flatbuffers. But I would
> >> argue that the actual encoding of the metadata is *not* what defines a
> >> format, at all; it is just a means to encode the logical structure, and
> >> while this structure has some resemblance between Arrow and Parquet, there
> >> are actually a lot of differences. Each format somehow has to do it and
> >> just because two formats may decide to use the same encoding (e.g.,
> >> flatbuffers) that doesn't make them very similar.
> >>
> >> But here is the greatest dissimilarity:
> >> Arrow was made to be an IPC streaming format. As such, it needs to be very
> >> fast to read and write. Then the python guys came and invented feather to
> >> make the whole thing also work somewhat as a storage format, but all they
> >> did was basically add a footer; the format itself (i.e., the encodings) are
> >> not at all optimized for a storage format. A storage format may / should
> >> use more heavyweight encodings and it is okay if it is more costly to
> >> write, as you expect it to be read multiple times while an IPC format is
> >> usually only read once.
> >>
> >> Could Arrow become more of a storage format by adding more heavyweight
> >> encodings, statistics, and indexes? It sure could! And maybe it will, but
> >> that's not what it was designed for, so I doubt that such things will be a
> >> high priority for Arrow. But I wouldn't - at least as of now - want to base
> >> a storage format on Arrow. There is just too much missing. A lot of things
> >> that Parquet has that Arrow hasn't (all the statistics, bloom filters,
> >> indexes, etc.). It may look like Parquet is becoming Arrow if it adopts
> >> flatbuffers as a metadata format, but I would argue that is not at all the
> >> case. The metadata encoding is just a tiny detail and a lot of other things
> >> are what makes Parquet Parquet.
> >>
> >> Cheers,
> >> Jan
> >>
> >>
> >>
> >>
> >> Am Do., 15. Aug. 2024 um 15:20 Uhr schrieb Raphael Taylor-Davies
> >> <r....@googlemail.com.invalid>:
> >>
> >>> Hi,
> >>>
> >>> One thing that occurs to me from reading a number of the proposals /
> >>> investigations in this space is how similar many of them end up looking
> >>> to Apache Arrow Feather / IPC. Parquet does have a narrower type system
> >>> and broader encoding and statistics support, but as far as the
> >>> underlying file structure is concerned feather looks a lot like many of
> >>> the parquet v3 proposals.
> >>>
> >>> Despite this feather has not seen especially broad adoption as far as I
> >>> am aware, and I therefore wonder if there might be relevant learnings
> >>> here? I also wonder if, for example, feather added better encoding
> >>> support, we would get something that met all the requirements, without
> >>> needing to effectively create a third file format?
> >>>
> >>> To be clear I have no particular affection for feather, in fact I find
> >>> the way it handles dictionaries to be especially distasteful, but I
> >>> wonder if there might be mileage in building off an existing format
> >>> instead of defining another flatbuffer based tabular encoding...
> >>>
> >>> Kind Regards,
> >>>
> >>> Raphael
> >>>
> >>> On 15/08/2024 13:41, Jan Finis wrote:
> >>> > I guess most close source implementations have done these optimizations
> >>> > already, it has just not been done in the open source versions. E.g., we
> >>> > switched to a custom-built thrift runtime using pool allocators and
> >>> string
> >>> > views instead of copied strings a few years ago, seeing comparable
> >>> > speed-ups. The C++ thrift library is just horribly inefficient.
> >>> >
> >>> > I agree with Alkis though that there are some gains that can be
> >>> achieved by
> >>> > optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
> >>> > more efficient but at the cost of increased size.
> >>> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> >>> >
> >>> > Cheers,
> >>> > Jan
> >>> >
> >>> > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> >>> > andrewlamb11@gmail.com>:
> >>> >
> >>> >> I don't disagree that flatbuffers would be faster than thrift decoding
> >>> >>
> >>> >> I am trying to say that with software engineering only (no change to
> >>> the
> >>> >> format) it is likely possible to increase parquet thrift metadata
> >>> parsing
> >>> >> speed by 4x.
> >>> >>
> >>> >> This is not 25x of course, but 4x is non trivial.
> >>> >>
> >>> >> The fact that no one yet has bothered to invest the time to get the 4x
> >>> yet
> >>> >> in open source implementations of parquet suggests to me that the
> >>> parsing
> >>> >> time may not be as critical an issue as we think
> >>> >>
> >>> >> Andrew
> >>> >>
> >>> >> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> >>> >> <al...@databricks.com.invalid> wrote:
> >>> >>
> >>> >>> The difference in parsing speed between thrift and flatbuffer is >25x.
> >>> >>> Thrift has some fundamental design decisions that make decoding slow:
> >>> >>> 1. the thrift compact protocol is very data dependent: uleb encoding
> >>> for
> >>> >>> integers, field ids are deltas from previous. The data dependencies
> >>> >>> disallow pipelining of modern cpus
> >>> >>> 2. object model does not have a way to use arenas to avoid many
> >>> >> allocations
> >>> >>> of objects
> >>> >>> If we keep thrift, we can potentially get 2 fixed, but fixing 1
> >>> requires
> >>> >>> changes to the thrift serialization protocol. Such a change is not
> >>> >>> different from switching serialization format.
> >>> >>>
> >>> >>>
> >>> >>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
> >>> >>> wrote:
> >>> >>>
> >>> >>>> I wanted to share some work Xiangpeng Hao did at InfluxData this
> >>> summer
> >>> >>> on
> >>> >>>> the current (thrift) metadata format[1].
> >>> >>>>
> >>> >>>> We found that with careful software engineering, we could likely
> >>> >> improve
> >>> >>>> the speed of reading existing parquet footer format by a factor of 4
> >>> or
> >>> >>>> more ([2] contains some specific ideas). While we analyzed the
> >>> >>>> Rust implementation, I believe a similar conclusion applies to C/C++.
> >>> >>>>
> >>> >>>> I realize that there are certain features that switching to an
> >>> entirely
> >>> >>> new
> >>> >>>> footer format would achieve, but the cost to adopting a new format
> >>> >>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> >>> >>>>
> >>> >>>> It is my opinion that investing the same effort in software
> >>> >> optimization
> >>> >>>> that would be required for a new footer format would have a much
> >>> bigger
> >>> >>>> impact
> >>> >>>>
> >>> >>>> Andrew
> >>> >>>>
> >>> >>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> >>> >>>> [2]: https://github.com/apache/arrow-rs/issues/5853
> >>> >>>>
> >>> >>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> >>> >>>> <al...@databricks.com.invalid> wrote:
> >>> >>>>
> >>> >>>>> Hi Julien.
> >>> >>>>>
> >>> >>>>> Thank you for reconnecting the threads.
> >>> >>>>>
> >>> >>>>> I have broken down my experiments in a narrative, commit by commit
> >>> on
> >>> >>> how
> >>> >>>>> we can go from flatbuffers being ~2x larger than thrift to being
> >>> >>> smaller
> >>> >>>>> (and at times even half) the size of thrift. This is still on an
> >>> >>> internal
> >>> >>>>> branch, I will resume work towards the end of this month to port it
> >>> >> to
> >>> >>>>> arrow so that folks can look at the progress and share ideas.
> >>> >>>>>
> >>> >>>>> On the benchmarking front I need to build and share a binary for
> >>> >> third
> >>> >>>>> parties to donate their footers for analysis.
> >>> >>>>>
> >>> >>>>> The PR for parquet extensions has gotten a few rounds of reviews:
> >>> >>>>> https://github.com/apache/parquet-format/pull/254. I hope it will
> >>> be
> >>> >>>>> merged
> >>> >>>>> soon.
> >>> >>>>>
> >>> >>>>> I missed the sync yesterday - for some reason I didn't receive an
> >>> >>>>> invitation. Julien could you add me again to the invite list?
> >>> >>>>>
> >>> >>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
> >>> >>> wrote:
> >>> >>>>>> This came up in the sync today.
> >>> >>>>>>
> >>> >>>>>> There are a few concurrent experiments with flatbuffers for a
> >>> >> future
> >>> >>>>>> Parquet footer replacement. In itself it is fine and just wanted to
> >>> >>>>>> reconnect the threads here so that folks are aware of each other
> >>> >> and
> >>> >>>> can
> >>> >>>>>> share findings.
> >>> >>>>>>
> >>> >>>>>> - Neelaksh benchmarking and experiments:
> >>> >>>>>>
> >>> >>>>>>
> >>> >>
> >>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> >>> >>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> >>> >>>>>>
> >>> >>>>>> - Alkis has also been experimenting and led the proposal for
> >>> >> enabling
> >>> >>>>>> extending the existing footer.
> >>> >>>>>>
> >>> >>>>>>
> >>> >>
> >>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> >>> >>>>>> - Xuwei also shared that he is looking into this.
> >>> >>>>>>
> >>> >>>>>> I would suggest that you all reply to this thread sharing your
> >>> >>> current
> >>> >>>>>> progress or ideas and a link to your respective repos for
> >>> >>>> experimenting.
> >>> >>>>>> Best
> >>> >>>>>> Julien
> >>> >>>>>>
> >>>
> >>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Raphael Taylor-Davies <r....@googlemail.com.INVALID>.
Right, I'm not disputing that parquet has a lot of additional functionality that people could leverage compared to feather. However, many of the use-cases that have been articulated to justify switching parquet to flatbuffers don't benefit from many of these features. For example, ML workloads often exhibit some combination of random access, fixed length lists, no statistics or indexes, and sourcing data from fast NVMe storage that is bottlenecked by more expensive encodings. Similarly many others are making use of indexes maintained outside the files, obviating the need for indexes and statistics within the files themselves.
As I stated, feather is not without flaws, but it seems wise to assess which is closer to the desired feature set, rather than dismissing one out of hand because its total feature set is smaller. This does of course entail articulating what this feature set actually is, which may actually be the core of my question...
On 15 August 2024 14:50:08 BST, Jan Finis <jp...@gmail.com> wrote:
>(I don't want to come over as not liking Arrow; quite the opposite is the
>case, it's amazing for IPC and we also use it for that. And I do think we
>can and should learn from Arrow and there is a lot of things that would
>make sense to adopt or at least to get closer too, e.g., its type system.)
>
>Am Do., 15. Aug. 2024 um 15:46 Uhr schrieb Jan Finis <jp...@gmail.com>:
>
>> I
>>> wonder if there might be mileage in building off an existing format
>>> instead of defining another flatbuffer based tabular encoding
>>>
>>
>> We *are* building off an existing format. Parquet will stay as it is, its
>> logical structure and everything. The encoding used for this logical
>> structure's metadata is just a detail. In contrast, Arrow (Feather) is
>> missing so many things that Parquet has, so you would need a lot more work
>> to get to where Parquet is, if you started off with Arrow.
>>
>> I also wonder if, for example, feather added better encoding
>>> support, we would get something that met all the requirements, without
>>> needing to effectively create a third file format?
>>
>>
>> I would argue that feather is faaaaar farther away from being a good
>> storage format than Parquet is. Yes, you could add a lot of stuff to
>> feather to make it a great storage format, but it would be way more than
>> you would need to add to Parquet to make it as good. And you would also be
>> creating de facto a third format if you change that much. That's also why
>> Feather has little adoption: It's not a good storage format as of now, as
>> its based on Arrow and Arrow isn't design for that.
>>
>> One thing that occurs to me from reading a number of the proposals /
>>> investigations in this space is how similar many of them end up looking
>>> to Apache Arrow Feather / IPC.
>>
>>
>> I would argue that Parquet and Arrow are actually not that similar. They
>> are similar, but only "trivially so" (i.e., in ways in which each storage
>> format would end up at a roughly similar design):
>>
>> Obvious similarities:
>> * Most modern formats are chunked columnar, as this is just obviously a
>> good idea for many scenarios, as you can choose to skip columns and
>> chunking helps with being able to write without having to buffer all the
>> file before writing it. In that regard Parquet and Arrow are similar, but
>> so are ORC and others.
>> * Formats have some kind of metadata structure describing the file. In
>> that regard, Parquet and Arrow and all others are similar, but every format
>> needs this, so the similarity is trivial.
>> * Both have encodings. Again, any format needs this. Also the fact that
>> there is overlap in the encodings is just because some encodings are an
>> obviously good idea (e.g., dictionary).
>> * Both have a footer. Any format that wants to be able to be written in a
>> streaming fashion needs this, you don't know the metadata of the file yet
>> when you start writing, so you cannot use a header and putting the metadata
>> somewhere in the middle would make it hard to discover.
>>
>> Now, the metadata structure needs to be encoded, somehow. For this, modern
>> formats use encoding standards like thrift or flatbuffers. But I would
>> argue that the actual encoding of the metadata is *not* what defines a
>> format, at all; it is just a means to encode the logical structure, and
>> while this structure has some resemblance between Arrow and Parquet, there
>> are actually a lot of differences. Each format somehow has to do it and
>> just because two formats may decide to use the same encoding (e.g.,
>> flatbuffers) that doesn't make them very similar.
>>
>> But here is the greatest dissimilarity:
>> Arrow was made to be an IPC streaming format. As such, it needs to be very
>> fast to read and write. Then the python guys came and invented feather to
>> make the whole thing also work somewhat as a storage format, but all they
>> did was basically add a footer; the format itself (i.e., the encodings) are
>> not at all optimized for a storage format. A storage format may / should
>> use more heavyweight encodings and it is okay if it is more costly to
>> write, as you expect it to be read multiple times while an IPC format is
>> usually only read once.
>>
>> Could Arrow become more of a storage format by adding more heavyweight
>> encodings, statistics, and indexes? It sure could! And maybe it will, but
>> that's not what it was designed for, so I doubt that such things will be a
>> high priority for Arrow. But I wouldn't - at least as of now - want to base
>> a storage format on Arrow. There is just too much missing. A lot of things
>> that Parquet has that Arrow hasn't (all the statistics, bloom filters,
>> indexes, etc.). It may look like Parquet is becoming Arrow if it adopts
>> flatbuffers as a metadata format, but I would argue that is not at all the
>> case. The metadata encoding is just a tiny detail and a lot of other things
>> are what makes Parquet Parquet.
>>
>> Cheers,
>> Jan
>>
>>
>>
>>
>> Am Do., 15. Aug. 2024 um 15:20 Uhr schrieb Raphael Taylor-Davies
>> <r....@googlemail.com.invalid>:
>>
>>> Hi,
>>>
>>> One thing that occurs to me from reading a number of the proposals /
>>> investigations in this space is how similar many of them end up looking
>>> to Apache Arrow Feather / IPC. Parquet does have a narrower type system
>>> and broader encoding and statistics support, but as far as the
>>> underlying file structure is concerned feather looks a lot like many of
>>> the parquet v3 proposals.
>>>
>>> Despite this feather has not seen especially broad adoption as far as I
>>> am aware, and I therefore wonder if there might be relevant learnings
>>> here? I also wonder if, for example, feather added better encoding
>>> support, we would get something that met all the requirements, without
>>> needing to effectively create a third file format?
>>>
>>> To be clear I have no particular affection for feather, in fact I find
>>> the way it handles dictionaries to be especially distasteful, but I
>>> wonder if there might be mileage in building off an existing format
>>> instead of defining another flatbuffer based tabular encoding...
>>>
>>> Kind Regards,
>>>
>>> Raphael
>>>
>>> On 15/08/2024 13:41, Jan Finis wrote:
>>> > I guess most close source implementations have done these optimizations
>>> > already, it has just not been done in the open source versions. E.g., we
>>> > switched to a custom-built thrift runtime using pool allocators and
>>> string
>>> > views instead of copied strings a few years ago, seeing comparable
>>> > speed-ups. The C++ thrift library is just horribly inefficient.
>>> >
>>> > I agree with Alkis though that there are some gains that can be
>>> achieved by
>>> > optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
>>> > more efficient but at the cost of increased size.
>>> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
>>> >
>>> > Cheers,
>>> > Jan
>>> >
>>> > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
>>> > andrewlamb11@gmail.com>:
>>> >
>>> >> I don't disagree that flatbuffers would be faster than thrift decoding
>>> >>
>>> >> I am trying to say that with software engineering only (no change to
>>> the
>>> >> format) it is likely possible to increase parquet thrift metadata
>>> parsing
>>> >> speed by 4x.
>>> >>
>>> >> This is not 25x of course, but 4x is non trivial.
>>> >>
>>> >> The fact that no one yet has bothered to invest the time to get the 4x
>>> yet
>>> >> in open source implementations of parquet suggests to me that the
>>> parsing
>>> >> time may not be as critical an issue as we think
>>> >>
>>> >> Andrew
>>> >>
>>> >> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
>>> >> <al...@databricks.com.invalid> wrote:
>>> >>
>>> >>> The difference in parsing speed between thrift and flatbuffer is >25x.
>>> >>> Thrift has some fundamental design decisions that make decoding slow:
>>> >>> 1. the thrift compact protocol is very data dependent: uleb encoding
>>> for
>>> >>> integers, field ids are deltas from previous. The data dependencies
>>> >>> disallow pipelining of modern cpus
>>> >>> 2. object model does not have a way to use arenas to avoid many
>>> >> allocations
>>> >>> of objects
>>> >>> If we keep thrift, we can potentially get 2 fixed, but fixing 1
>>> requires
>>> >>> changes to the thrift serialization protocol. Such a change is not
>>> >>> different from switching serialization format.
>>> >>>
>>> >>>
>>> >>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
>>> >>> wrote:
>>> >>>
>>> >>>> I wanted to share some work Xiangpeng Hao did at InfluxData this
>>> summer
>>> >>> on
>>> >>>> the current (thrift) metadata format[1].
>>> >>>>
>>> >>>> We found that with careful software engineering, we could likely
>>> >> improve
>>> >>>> the speed of reading existing parquet footer format by a factor of 4
>>> or
>>> >>>> more ([2] contains some specific ideas). While we analyzed the
>>> >>>> Rust implementation, I believe a similar conclusion applies to C/C++.
>>> >>>>
>>> >>>> I realize that there are certain features that switching to an
>>> entirely
>>> >>> new
>>> >>>> footer format would achieve, but the cost to adopting a new format
>>> >>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
>>> >>>>
>>> >>>> It is my opinion that investing the same effort in software
>>> >> optimization
>>> >>>> that would be required for a new footer format would have a much
>>> bigger
>>> >>>> impact
>>> >>>>
>>> >>>> Andrew
>>> >>>>
>>> >>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
>>> >>>> [2]: https://github.com/apache/arrow-rs/issues/5853
>>> >>>>
>>> >>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
>>> >>>> <al...@databricks.com.invalid> wrote:
>>> >>>>
>>> >>>>> Hi Julien.
>>> >>>>>
>>> >>>>> Thank you for reconnecting the threads.
>>> >>>>>
>>> >>>>> I have broken down my experiments in a narrative, commit by commit
>>> on
>>> >>> how
>>> >>>>> we can go from flatbuffers being ~2x larger than thrift to being
>>> >>> smaller
>>> >>>>> (and at times even half) the size of thrift. This is still on an
>>> >>> internal
>>> >>>>> branch, I will resume work towards the end of this month to port it
>>> >> to
>>> >>>>> arrow so that folks can look at the progress and share ideas.
>>> >>>>>
>>> >>>>> On the benchmarking front I need to build and share a binary for
>>> >> third
>>> >>>>> parties to donate their footers for analysis.
>>> >>>>>
>>> >>>>> The PR for parquet extensions has gotten a few rounds of reviews:
>>> >>>>> https://github.com/apache/parquet-format/pull/254. I hope it will
>>> be
>>> >>>>> merged
>>> >>>>> soon.
>>> >>>>>
>>> >>>>> I missed the sync yesterday - for some reason I didn't receive an
>>> >>>>> invitation. Julien could you add me again to the invite list?
>>> >>>>>
>>> >>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
>>> >>> wrote:
>>> >>>>>> This came up in the sync today.
>>> >>>>>>
>>> >>>>>> There are a few concurrent experiments with flatbuffers for a
>>> >> future
>>> >>>>>> Parquet footer replacement. In itself it is fine and just wanted to
>>> >>>>>> reconnect the threads here so that folks are aware of each other
>>> >> and
>>> >>>> can
>>> >>>>>> share findings.
>>> >>>>>>
>>> >>>>>> - Neelaksh benchmarking and experiments:
>>> >>>>>>
>>> >>>>>>
>>> >>
>>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>>> >>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>>> >>>>>>
>>> >>>>>> - Alkis has also been experimenting and led the proposal for
>>> >> enabling
>>> >>>>>> extending the existing footer.
>>> >>>>>>
>>> >>>>>>
>>> >>
>>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>>> >>>>>> - Xuwei also shared that he is looking into this.
>>> >>>>>>
>>> >>>>>> I would suggest that you all reply to this thread sharing your
>>> >>> current
>>> >>>>>> progress or ideas and a link to your respective repos for
>>> >>>> experimenting.
>>> >>>>>> Best
>>> >>>>>> Julien
>>> >>>>>>
>>>
>>
Re: [DISCUSS] new Parquet footer experiments
Posted by Jan Finis <jp...@gmail.com>.
(I don't want to come over as not liking Arrow; quite the opposite is the
case, it's amazing for IPC and we also use it for that. And I do think we
can and should learn from Arrow and there is a lot of things that would
make sense to adopt or at least to get closer too, e.g., its type system.)
Am Do., 15. Aug. 2024 um 15:46 Uhr schrieb Jan Finis <jp...@gmail.com>:
> I
>> wonder if there might be mileage in building off an existing format
>> instead of defining another flatbuffer based tabular encoding
>>
>
> We *are* building off an existing format. Parquet will stay as it is, its
> logical structure and everything. The encoding used for this logical
> structure's metadata is just a detail. In contrast, Arrow (Feather) is
> missing so many things that Parquet has, so you would need a lot more work
> to get to where Parquet is, if you started off with Arrow.
>
> I also wonder if, for example, feather added better encoding
>> support, we would get something that met all the requirements, without
>> needing to effectively create a third file format?
>
>
> I would argue that feather is faaaaar farther away from being a good
> storage format than Parquet is. Yes, you could add a lot of stuff to
> feather to make it a great storage format, but it would be way more than
> you would need to add to Parquet to make it as good. And you would also be
> creating de facto a third format if you change that much. That's also why
> Feather has little adoption: It's not a good storage format as of now, as
> its based on Arrow and Arrow isn't design for that.
>
> One thing that occurs to me from reading a number of the proposals /
>> investigations in this space is how similar many of them end up looking
>> to Apache Arrow Feather / IPC.
>
>
> I would argue that Parquet and Arrow are actually not that similar. They
> are similar, but only "trivially so" (i.e., in ways in which each storage
> format would end up at a roughly similar design):
>
> Obvious similarities:
> * Most modern formats are chunked columnar, as this is just obviously a
> good idea for many scenarios, as you can choose to skip columns and
> chunking helps with being able to write without having to buffer all the
> file before writing it. In that regard Parquet and Arrow are similar, but
> so are ORC and others.
> * Formats have some kind of metadata structure describing the file. In
> that regard, Parquet and Arrow and all others are similar, but every format
> needs this, so the similarity is trivial.
> * Both have encodings. Again, any format needs this. Also the fact that
> there is overlap in the encodings is just because some encodings are an
> obviously good idea (e.g., dictionary).
> * Both have a footer. Any format that wants to be able to be written in a
> streaming fashion needs this, you don't know the metadata of the file yet
> when you start writing, so you cannot use a header and putting the metadata
> somewhere in the middle would make it hard to discover.
>
> Now, the metadata structure needs to be encoded, somehow. For this, modern
> formats use encoding standards like thrift or flatbuffers. But I would
> argue that the actual encoding of the metadata is *not* what defines a
> format, at all; it is just a means to encode the logical structure, and
> while this structure has some resemblance between Arrow and Parquet, there
> are actually a lot of differences. Each format somehow has to do it and
> just because two formats may decide to use the same encoding (e.g.,
> flatbuffers) that doesn't make them very similar.
>
> But here is the greatest dissimilarity:
> Arrow was made to be an IPC streaming format. As such, it needs to be very
> fast to read and write. Then the python guys came and invented feather to
> make the whole thing also work somewhat as a storage format, but all they
> did was basically add a footer; the format itself (i.e., the encodings) are
> not at all optimized for a storage format. A storage format may / should
> use more heavyweight encodings and it is okay if it is more costly to
> write, as you expect it to be read multiple times while an IPC format is
> usually only read once.
>
> Could Arrow become more of a storage format by adding more heavyweight
> encodings, statistics, and indexes? It sure could! And maybe it will, but
> that's not what it was designed for, so I doubt that such things will be a
> high priority for Arrow. But I wouldn't - at least as of now - want to base
> a storage format on Arrow. There is just too much missing. A lot of things
> that Parquet has that Arrow hasn't (all the statistics, bloom filters,
> indexes, etc.). It may look like Parquet is becoming Arrow if it adopts
> flatbuffers as a metadata format, but I would argue that is not at all the
> case. The metadata encoding is just a tiny detail and a lot of other things
> are what makes Parquet Parquet.
>
> Cheers,
> Jan
>
>
>
>
> Am Do., 15. Aug. 2024 um 15:20 Uhr schrieb Raphael Taylor-Davies
> <r....@googlemail.com.invalid>:
>
>> Hi,
>>
>> One thing that occurs to me from reading a number of the proposals /
>> investigations in this space is how similar many of them end up looking
>> to Apache Arrow Feather / IPC. Parquet does have a narrower type system
>> and broader encoding and statistics support, but as far as the
>> underlying file structure is concerned feather looks a lot like many of
>> the parquet v3 proposals.
>>
>> Despite this feather has not seen especially broad adoption as far as I
>> am aware, and I therefore wonder if there might be relevant learnings
>> here? I also wonder if, for example, feather added better encoding
>> support, we would get something that met all the requirements, without
>> needing to effectively create a third file format?
>>
>> To be clear I have no particular affection for feather, in fact I find
>> the way it handles dictionaries to be especially distasteful, but I
>> wonder if there might be mileage in building off an existing format
>> instead of defining another flatbuffer based tabular encoding...
>>
>> Kind Regards,
>>
>> Raphael
>>
>> On 15/08/2024 13:41, Jan Finis wrote:
>> > I guess most close source implementations have done these optimizations
>> > already, it has just not been done in the open source versions. E.g., we
>> > switched to a custom-built thrift runtime using pool allocators and
>> string
>> > views instead of copied strings a few years ago, seeing comparable
>> > speed-ups. The C++ thrift library is just horribly inefficient.
>> >
>> > I agree with Alkis though that there are some gains that can be
>> achieved by
>> > optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
>> > more efficient but at the cost of increased size.
>> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
>> >
>> > Cheers,
>> > Jan
>> >
>> > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
>> > andrewlamb11@gmail.com>:
>> >
>> >> I don't disagree that flatbuffers would be faster than thrift decoding
>> >>
>> >> I am trying to say that with software engineering only (no change to
>> the
>> >> format) it is likely possible to increase parquet thrift metadata
>> parsing
>> >> speed by 4x.
>> >>
>> >> This is not 25x of course, but 4x is non trivial.
>> >>
>> >> The fact that no one yet has bothered to invest the time to get the 4x
>> yet
>> >> in open source implementations of parquet suggests to me that the
>> parsing
>> >> time may not be as critical an issue as we think
>> >>
>> >> Andrew
>> >>
>> >> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
>> >> <al...@databricks.com.invalid> wrote:
>> >>
>> >>> The difference in parsing speed between thrift and flatbuffer is >25x.
>> >>> Thrift has some fundamental design decisions that make decoding slow:
>> >>> 1. the thrift compact protocol is very data dependent: uleb encoding
>> for
>> >>> integers, field ids are deltas from previous. The data dependencies
>> >>> disallow pipelining of modern cpus
>> >>> 2. object model does not have a way to use arenas to avoid many
>> >> allocations
>> >>> of objects
>> >>> If we keep thrift, we can potentially get 2 fixed, but fixing 1
>> requires
>> >>> changes to the thrift serialization protocol. Such a change is not
>> >>> different from switching serialization format.
>> >>>
>> >>>
>> >>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
>> >>> wrote:
>> >>>
>> >>>> I wanted to share some work Xiangpeng Hao did at InfluxData this
>> summer
>> >>> on
>> >>>> the current (thrift) metadata format[1].
>> >>>>
>> >>>> We found that with careful software engineering, we could likely
>> >> improve
>> >>>> the speed of reading existing parquet footer format by a factor of 4
>> or
>> >>>> more ([2] contains some specific ideas). While we analyzed the
>> >>>> Rust implementation, I believe a similar conclusion applies to C/C++.
>> >>>>
>> >>>> I realize that there are certain features that switching to an
>> entirely
>> >>> new
>> >>>> footer format would achieve, but the cost to adopting a new format
>> >>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
>> >>>>
>> >>>> It is my opinion that investing the same effort in software
>> >> optimization
>> >>>> that would be required for a new footer format would have a much
>> bigger
>> >>>> impact
>> >>>>
>> >>>> Andrew
>> >>>>
>> >>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
>> >>>> [2]: https://github.com/apache/arrow-rs/issues/5853
>> >>>>
>> >>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
>> >>>> <al...@databricks.com.invalid> wrote:
>> >>>>
>> >>>>> Hi Julien.
>> >>>>>
>> >>>>> Thank you for reconnecting the threads.
>> >>>>>
>> >>>>> I have broken down my experiments in a narrative, commit by commit
>> on
>> >>> how
>> >>>>> we can go from flatbuffers being ~2x larger than thrift to being
>> >>> smaller
>> >>>>> (and at times even half) the size of thrift. This is still on an
>> >>> internal
>> >>>>> branch, I will resume work towards the end of this month to port it
>> >> to
>> >>>>> arrow so that folks can look at the progress and share ideas.
>> >>>>>
>> >>>>> On the benchmarking front I need to build and share a binary for
>> >> third
>> >>>>> parties to donate their footers for analysis.
>> >>>>>
>> >>>>> The PR for parquet extensions has gotten a few rounds of reviews:
>> >>>>> https://github.com/apache/parquet-format/pull/254. I hope it will
>> be
>> >>>>> merged
>> >>>>> soon.
>> >>>>>
>> >>>>> I missed the sync yesterday - for some reason I didn't receive an
>> >>>>> invitation. Julien could you add me again to the invite list?
>> >>>>>
>> >>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
>> >>> wrote:
>> >>>>>> This came up in the sync today.
>> >>>>>>
>> >>>>>> There are a few concurrent experiments with flatbuffers for a
>> >> future
>> >>>>>> Parquet footer replacement. In itself it is fine and just wanted to
>> >>>>>> reconnect the threads here so that folks are aware of each other
>> >> and
>> >>>> can
>> >>>>>> share findings.
>> >>>>>>
>> >>>>>> - Neelaksh benchmarking and experiments:
>> >>>>>>
>> >>>>>>
>> >>
>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>> >>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>> >>>>>>
>> >>>>>> - Alkis has also been experimenting and led the proposal for
>> >> enabling
>> >>>>>> extending the existing footer.
>> >>>>>>
>> >>>>>>
>> >>
>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>> >>>>>> - Xuwei also shared that he is looking into this.
>> >>>>>>
>> >>>>>> I would suggest that you all reply to this thread sharing your
>> >>> current
>> >>>>>> progress or ideas and a link to your respective repos for
>> >>>> experimenting.
>> >>>>>> Best
>> >>>>>> Julien
>> >>>>>>
>>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Jan Finis <jp...@gmail.com>.
>
> I
> wonder if there might be mileage in building off an existing format
> instead of defining another flatbuffer based tabular encoding
>
We *are* building off an existing format. Parquet will stay as it is, its
logical structure and everything. The encoding used for this logical
structure's metadata is just a detail. In contrast, Arrow (Feather) is
missing so many things that Parquet has, so you would need a lot more work
to get to where Parquet is, if you started off with Arrow.
I also wonder if, for example, feather added better encoding
> support, we would get something that met all the requirements, without
> needing to effectively create a third file format?
I would argue that feather is faaaaar farther away from being a good
storage format than Parquet is. Yes, you could add a lot of stuff to
feather to make it a great storage format, but it would be way more than
you would need to add to Parquet to make it as good. And you would also be
creating de facto a third format if you change that much. That's also why
Feather has little adoption: It's not a good storage format as of now, as
its based on Arrow and Arrow isn't design for that.
One thing that occurs to me from reading a number of the proposals /
> investigations in this space is how similar many of them end up looking
> to Apache Arrow Feather / IPC.
I would argue that Parquet and Arrow are actually not that similar. They
are similar, but only "trivially so" (i.e., in ways in which each storage
format would end up at a roughly similar design):
Obvious similarities:
* Most modern formats are chunked columnar, as this is just obviously a
good idea for many scenarios, as you can choose to skip columns and
chunking helps with being able to write without having to buffer all the
file before writing it. In that regard Parquet and Arrow are similar, but
so are ORC and others.
* Formats have some kind of metadata structure describing the file. In that
regard, Parquet and Arrow and all others are similar, but every format
needs this, so the similarity is trivial.
* Both have encodings. Again, any format needs this. Also the fact that
there is overlap in the encodings is just because some encodings are an
obviously good idea (e.g., dictionary).
* Both have a footer. Any format that wants to be able to be written in a
streaming fashion needs this, you don't know the metadata of the file yet
when you start writing, so you cannot use a header and putting the metadata
somewhere in the middle would make it hard to discover.
Now, the metadata structure needs to be encoded, somehow. For this, modern
formats use encoding standards like thrift or flatbuffers. But I would
argue that the actual encoding of the metadata is *not* what defines a
format, at all; it is just a means to encode the logical structure, and
while this structure has some resemblance between Arrow and Parquet, there
are actually a lot of differences. Each format somehow has to do it and
just because two formats may decide to use the same encoding (e.g.,
flatbuffers) that doesn't make them very similar.
But here is the greatest dissimilarity:
Arrow was made to be an IPC streaming format. As such, it needs to be very
fast to read and write. Then the python guys came and invented feather to
make the whole thing also work somewhat as a storage format, but all they
did was basically add a footer; the format itself (i.e., the encodings) are
not at all optimized for a storage format. A storage format may / should
use more heavyweight encodings and it is okay if it is more costly to
write, as you expect it to be read multiple times while an IPC format is
usually only read once.
Could Arrow become more of a storage format by adding more heavyweight
encodings, statistics, and indexes? It sure could! And maybe it will, but
that's not what it was designed for, so I doubt that such things will be a
high priority for Arrow. But I wouldn't - at least as of now - want to base
a storage format on Arrow. There is just too much missing. A lot of things
that Parquet has that Arrow hasn't (all the statistics, bloom filters,
indexes, etc.). It may look like Parquet is becoming Arrow if it adopts
flatbuffers as a metadata format, but I would argue that is not at all the
case. The metadata encoding is just a tiny detail and a lot of other things
are what makes Parquet Parquet.
Cheers,
Jan
Am Do., 15. Aug. 2024 um 15:20 Uhr schrieb Raphael Taylor-Davies
<r....@googlemail.com.invalid>:
> Hi,
>
> One thing that occurs to me from reading a number of the proposals /
> investigations in this space is how similar many of them end up looking
> to Apache Arrow Feather / IPC. Parquet does have a narrower type system
> and broader encoding and statistics support, but as far as the
> underlying file structure is concerned feather looks a lot like many of
> the parquet v3 proposals.
>
> Despite this feather has not seen especially broad adoption as far as I
> am aware, and I therefore wonder if there might be relevant learnings
> here? I also wonder if, for example, feather added better encoding
> support, we would get something that met all the requirements, without
> needing to effectively create a third file format?
>
> To be clear I have no particular affection for feather, in fact I find
> the way it handles dictionaries to be especially distasteful, but I
> wonder if there might be mileage in building off an existing format
> instead of defining another flatbuffer based tabular encoding...
>
> Kind Regards,
>
> Raphael
>
> On 15/08/2024 13:41, Jan Finis wrote:
> > I guess most close source implementations have done these optimizations
> > already, it has just not been done in the open source versions. E.g., we
> > switched to a custom-built thrift runtime using pool allocators and
> string
> > views instead of copied strings a few years ago, seeing comparable
> > speed-ups. The C++ thrift library is just horribly inefficient.
> >
> > I agree with Alkis though that there are some gains that can be achieved
> by
> > optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
> > more efficient but at the cost of increased size.
> > Alkis, can you elaborate how you brought the size of Flatbuffers down?
> >
> > Cheers,
> > Jan
> >
> > Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> > andrewlamb11@gmail.com>:
> >
> >> I don't disagree that flatbuffers would be faster than thrift decoding
> >>
> >> I am trying to say that with software engineering only (no change to the
> >> format) it is likely possible to increase parquet thrift metadata
> parsing
> >> speed by 4x.
> >>
> >> This is not 25x of course, but 4x is non trivial.
> >>
> >> The fact that no one yet has bothered to invest the time to get the 4x
> yet
> >> in open source implementations of parquet suggests to me that the
> parsing
> >> time may not be as critical an issue as we think
> >>
> >> Andrew
> >>
> >> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> >> <al...@databricks.com.invalid> wrote:
> >>
> >>> The difference in parsing speed between thrift and flatbuffer is >25x.
> >>> Thrift has some fundamental design decisions that make decoding slow:
> >>> 1. the thrift compact protocol is very data dependent: uleb encoding
> for
> >>> integers, field ids are deltas from previous. The data dependencies
> >>> disallow pipelining of modern cpus
> >>> 2. object model does not have a way to use arenas to avoid many
> >> allocations
> >>> of objects
> >>> If we keep thrift, we can potentially get 2 fixed, but fixing 1
> requires
> >>> changes to the thrift serialization protocol. Such a change is not
> >>> different from switching serialization format.
> >>>
> >>>
> >>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
> >>> wrote:
> >>>
> >>>> I wanted to share some work Xiangpeng Hao did at InfluxData this
> summer
> >>> on
> >>>> the current (thrift) metadata format[1].
> >>>>
> >>>> We found that with careful software engineering, we could likely
> >> improve
> >>>> the speed of reading existing parquet footer format by a factor of 4
> or
> >>>> more ([2] contains some specific ideas). While we analyzed the
> >>>> Rust implementation, I believe a similar conclusion applies to C/C++.
> >>>>
> >>>> I realize that there are certain features that switching to an
> entirely
> >>> new
> >>>> footer format would achieve, but the cost to adopting a new format
> >>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> >>>>
> >>>> It is my opinion that investing the same effort in software
> >> optimization
> >>>> that would be required for a new footer format would have a much
> bigger
> >>>> impact
> >>>>
> >>>> Andrew
> >>>>
> >>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> >>>> [2]: https://github.com/apache/arrow-rs/issues/5853
> >>>>
> >>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> >>>> <al...@databricks.com.invalid> wrote:
> >>>>
> >>>>> Hi Julien.
> >>>>>
> >>>>> Thank you for reconnecting the threads.
> >>>>>
> >>>>> I have broken down my experiments in a narrative, commit by commit on
> >>> how
> >>>>> we can go from flatbuffers being ~2x larger than thrift to being
> >>> smaller
> >>>>> (and at times even half) the size of thrift. This is still on an
> >>> internal
> >>>>> branch, I will resume work towards the end of this month to port it
> >> to
> >>>>> arrow so that folks can look at the progress and share ideas.
> >>>>>
> >>>>> On the benchmarking front I need to build and share a binary for
> >> third
> >>>>> parties to donate their footers for analysis.
> >>>>>
> >>>>> The PR for parquet extensions has gotten a few rounds of reviews:
> >>>>> https://github.com/apache/parquet-format/pull/254. I hope it will be
> >>>>> merged
> >>>>> soon.
> >>>>>
> >>>>> I missed the sync yesterday - for some reason I didn't receive an
> >>>>> invitation. Julien could you add me again to the invite list?
> >>>>>
> >>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
> >>> wrote:
> >>>>>> This came up in the sync today.
> >>>>>>
> >>>>>> There are a few concurrent experiments with flatbuffers for a
> >> future
> >>>>>> Parquet footer replacement. In itself it is fine and just wanted to
> >>>>>> reconnect the threads here so that folks are aware of each other
> >> and
> >>>> can
> >>>>>> share findings.
> >>>>>>
> >>>>>> - Neelaksh benchmarking and experiments:
> >>>>>>
> >>>>>>
> >>
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> >>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> >>>>>>
> >>>>>> - Alkis has also been experimenting and led the proposal for
> >> enabling
> >>>>>> extending the existing footer.
> >>>>>>
> >>>>>>
> >>
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> >>>>>> - Xuwei also shared that he is looking into this.
> >>>>>>
> >>>>>> I would suggest that you all reply to this thread sharing your
> >>> current
> >>>>>> progress or ideas and a link to your respective repos for
> >>>> experimenting.
> >>>>>> Best
> >>>>>> Julien
> >>>>>>
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Raphael Taylor-Davies <r....@googlemail.com.INVALID>.
Hi,
One thing that occurs to me from reading a number of the proposals /
investigations in this space is how similar many of them end up looking
to Apache Arrow Feather / IPC. Parquet does have a narrower type system
and broader encoding and statistics support, but as far as the
underlying file structure is concerned feather looks a lot like many of
the parquet v3 proposals.
Despite this feather has not seen especially broad adoption as far as I
am aware, and I therefore wonder if there might be relevant learnings
here? I also wonder if, for example, feather added better encoding
support, we would get something that met all the requirements, without
needing to effectively create a third file format?
To be clear I have no particular affection for feather, in fact I find
the way it handles dictionaries to be especially distasteful, but I
wonder if there might be mileage in building off an existing format
instead of defining another flatbuffer based tabular encoding...
Kind Regards,
Raphael
On 15/08/2024 13:41, Jan Finis wrote:
> I guess most close source implementations have done these optimizations
> already, it has just not been done in the open source versions. E.g., we
> switched to a custom-built thrift runtime using pool allocators and string
> views instead of copied strings a few years ago, seeing comparable
> speed-ups. The C++ thrift library is just horribly inefficient.
>
> I agree with Alkis though that there are some gains that can be achieved by
> optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
> more efficient but at the cost of increased size.
> Alkis, can you elaborate how you brought the size of Flatbuffers down?
>
> Cheers,
> Jan
>
> Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
> andrewlamb11@gmail.com>:
>
>> I don't disagree that flatbuffers would be faster than thrift decoding
>>
>> I am trying to say that with software engineering only (no change to the
>> format) it is likely possible to increase parquet thrift metadata parsing
>> speed by 4x.
>>
>> This is not 25x of course, but 4x is non trivial.
>>
>> The fact that no one yet has bothered to invest the time to get the 4x yet
>> in open source implementations of parquet suggests to me that the parsing
>> time may not be as critical an issue as we think
>>
>> Andrew
>>
>> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
>> <al...@databricks.com.invalid> wrote:
>>
>>> The difference in parsing speed between thrift and flatbuffer is >25x.
>>> Thrift has some fundamental design decisions that make decoding slow:
>>> 1. the thrift compact protocol is very data dependent: uleb encoding for
>>> integers, field ids are deltas from previous. The data dependencies
>>> disallow pipelining of modern cpus
>>> 2. object model does not have a way to use arenas to avoid many
>> allocations
>>> of objects
>>> If we keep thrift, we can potentially get 2 fixed, but fixing 1 requires
>>> changes to the thrift serialization protocol. Such a change is not
>>> different from switching serialization format.
>>>
>>>
>>> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
>>> wrote:
>>>
>>>> I wanted to share some work Xiangpeng Hao did at InfluxData this summer
>>> on
>>>> the current (thrift) metadata format[1].
>>>>
>>>> We found that with careful software engineering, we could likely
>> improve
>>>> the speed of reading existing parquet footer format by a factor of 4 or
>>>> more ([2] contains some specific ideas). While we analyzed the
>>>> Rust implementation, I believe a similar conclusion applies to C/C++.
>>>>
>>>> I realize that there are certain features that switching to an entirely
>>> new
>>>> footer format would achieve, but the cost to adopting a new format
>>>> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
>>>>
>>>> It is my opinion that investing the same effort in software
>> optimization
>>>> that would be required for a new footer format would have a much bigger
>>>> impact
>>>>
>>>> Andrew
>>>>
>>>> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
>>>> [2]: https://github.com/apache/arrow-rs/issues/5853
>>>>
>>>> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
>>>> <al...@databricks.com.invalid> wrote:
>>>>
>>>>> Hi Julien.
>>>>>
>>>>> Thank you for reconnecting the threads.
>>>>>
>>>>> I have broken down my experiments in a narrative, commit by commit on
>>> how
>>>>> we can go from flatbuffers being ~2x larger than thrift to being
>>> smaller
>>>>> (and at times even half) the size of thrift. This is still on an
>>> internal
>>>>> branch, I will resume work towards the end of this month to port it
>> to
>>>>> arrow so that folks can look at the progress and share ideas.
>>>>>
>>>>> On the benchmarking front I need to build and share a binary for
>> third
>>>>> parties to donate their footers for analysis.
>>>>>
>>>>> The PR for parquet extensions has gotten a few rounds of reviews:
>>>>> https://github.com/apache/parquet-format/pull/254. I hope it will be
>>>>> merged
>>>>> soon.
>>>>>
>>>>> I missed the sync yesterday - for some reason I didn't receive an
>>>>> invitation. Julien could you add me again to the invite list?
>>>>>
>>>>> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
>>> wrote:
>>>>>> This came up in the sync today.
>>>>>>
>>>>>> There are a few concurrent experiments with flatbuffers for a
>> future
>>>>>> Parquet footer replacement. In itself it is fine and just wanted to
>>>>>> reconnect the threads here so that folks are aware of each other
>> and
>>>> can
>>>>>> share findings.
>>>>>>
>>>>>> - Neelaksh benchmarking and experiments:
>>>>>>
>>>>>>
>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>>>>>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>>>>>>
>>>>>> - Alkis has also been experimenting and led the proposal for
>> enabling
>>>>>> extending the existing footer.
>>>>>>
>>>>>>
>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>>>>>> - Xuwei also shared that he is looking into this.
>>>>>>
>>>>>> I would suggest that you all reply to this thread sharing your
>>> current
>>>>>> progress or ideas and a link to your respective repos for
>>>> experimenting.
>>>>>> Best
>>>>>> Julien
>>>>>>
Re: [DISCUSS] new Parquet footer experiments
Posted by Jan Finis <jp...@gmail.com>.
I guess most close source implementations have done these optimizations
already, it has just not been done in the open source versions. E.g., we
switched to a custom-built thrift runtime using pool allocators and string
views instead of copied strings a few years ago, seeing comparable
speed-ups. The C++ thrift library is just horribly inefficient.
I agree with Alkis though that there are some gains that can be achieved by
optimizing, but the format has inherent drawbacks. Flatbuffers is indeed
more efficient but at the cost of increased size.
Alkis, can you elaborate how you brought the size of Flatbuffers down?
Cheers,
Jan
Am Do., 15. Aug. 2024 um 13:50 Uhr schrieb Andrew Lamb <
andrewlamb11@gmail.com>:
> I don't disagree that flatbuffers would be faster than thrift decoding
>
> I am trying to say that with software engineering only (no change to the
> format) it is likely possible to increase parquet thrift metadata parsing
> speed by 4x.
>
> This is not 25x of course, but 4x is non trivial.
>
> The fact that no one yet has bothered to invest the time to get the 4x yet
> in open source implementations of parquet suggests to me that the parsing
> time may not be as critical an issue as we think
>
> Andrew
>
> On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
> <al...@databricks.com.invalid> wrote:
>
> > The difference in parsing speed between thrift and flatbuffer is >25x.
> > Thrift has some fundamental design decisions that make decoding slow:
> > 1. the thrift compact protocol is very data dependent: uleb encoding for
> > integers, field ids are deltas from previous. The data dependencies
> > disallow pipelining of modern cpus
> > 2. object model does not have a way to use arenas to avoid many
> allocations
> > of objects
> > If we keep thrift, we can potentially get 2 fixed, but fixing 1 requires
> > changes to the thrift serialization protocol. Such a change is not
> > different from switching serialization format.
> >
> >
> > On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
> > wrote:
> >
> > > I wanted to share some work Xiangpeng Hao did at InfluxData this summer
> > on
> > > the current (thrift) metadata format[1].
> > >
> > > We found that with careful software engineering, we could likely
> improve
> > > the speed of reading existing parquet footer format by a factor of 4 or
> > > more ([2] contains some specific ideas). While we analyzed the
> > > Rust implementation, I believe a similar conclusion applies to C/C++.
> > >
> > > I realize that there are certain features that switching to an entirely
> > new
> > > footer format would achieve, but the cost to adopting a new format
> > > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> > >
> > > It is my opinion that investing the same effort in software
> optimization
> > > that would be required for a new footer format would have a much bigger
> > > impact
> > >
> > > Andrew
> > >
> > > [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > > [2]: https://github.com/apache/arrow-rs/issues/5853
> > >
> > > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > > <al...@databricks.com.invalid> wrote:
> > >
> > > > Hi Julien.
> > > >
> > > > Thank you for reconnecting the threads.
> > > >
> > > > I have broken down my experiments in a narrative, commit by commit on
> > how
> > > > we can go from flatbuffers being ~2x larger than thrift to being
> > smaller
> > > > (and at times even half) the size of thrift. This is still on an
> > internal
> > > > branch, I will resume work towards the end of this month to port it
> to
> > > > arrow so that folks can look at the progress and share ideas.
> > > >
> > > > On the benchmarking front I need to build and share a binary for
> third
> > > > parties to donate their footers for analysis.
> > > >
> > > > The PR for parquet extensions has gotten a few rounds of reviews:
> > > > https://github.com/apache/parquet-format/pull/254. I hope it will be
> > > > merged
> > > > soon.
> > > >
> > > > I missed the sync yesterday - for some reason I didn't receive an
> > > > invitation. Julien could you add me again to the invite list?
> > > >
> > > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
> > wrote:
> > > >
> > > > > This came up in the sync today.
> > > > >
> > > > > There are a few concurrent experiments with flatbuffers for a
> future
> > > > > Parquet footer replacement. In itself it is fine and just wanted to
> > > > > reconnect the threads here so that folks are aware of each other
> and
> > > can
> > > > > share findings.
> > > > >
> > > > > - Neelaksh benchmarking and experiments:
> > > > >
> > > > >
> > > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > > >
> > > > > - Alkis has also been experimenting and led the proposal for
> enabling
> > > > > extending the existing footer.
> > > > >
> > > > >
> > > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > > >
> > > > > - Xuwei also shared that he is looking into this.
> > > > >
> > > > > I would suggest that you all reply to this thread sharing your
> > current
> > > > > progress or ideas and a link to your respective repos for
> > > experimenting.
> > > > >
> > > > > Best
> > > > > Julien
> > > > >
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Andrew Lamb <an...@gmail.com>.
I don't disagree that flatbuffers would be faster than thrift decoding
I am trying to say that with software engineering only (no change to the
format) it is likely possible to increase parquet thrift metadata parsing
speed by 4x.
This is not 25x of course, but 4x is non trivial.
The fact that no one yet has bothered to invest the time to get the 4x yet
in open source implementations of parquet suggests to me that the parsing
time may not be as critical an issue as we think
Andrew
On Thu, Aug 15, 2024 at 6:50 AM Alkis Evlogimenos
<al...@databricks.com.invalid> wrote:
> The difference in parsing speed between thrift and flatbuffer is >25x.
> Thrift has some fundamental design decisions that make decoding slow:
> 1. the thrift compact protocol is very data dependent: uleb encoding for
> integers, field ids are deltas from previous. The data dependencies
> disallow pipelining of modern cpus
> 2. object model does not have a way to use arenas to avoid many allocations
> of objects
> If we keep thrift, we can potentially get 2 fixed, but fixing 1 requires
> changes to the thrift serialization protocol. Such a change is not
> different from switching serialization format.
>
>
> On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com>
> wrote:
>
> > I wanted to share some work Xiangpeng Hao did at InfluxData this summer
> on
> > the current (thrift) metadata format[1].
> >
> > We found that with careful software engineering, we could likely improve
> > the speed of reading existing parquet footer format by a factor of 4 or
> > more ([2] contains some specific ideas). While we analyzed the
> > Rust implementation, I believe a similar conclusion applies to C/C++.
> >
> > I realize that there are certain features that switching to an entirely
> new
> > footer format would achieve, but the cost to adopting a new format
> > across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
> >
> > It is my opinion that investing the same effort in software optimization
> > that would be required for a new footer format would have a much bigger
> > impact
> >
> > Andrew
> >
> > [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> > [2]: https://github.com/apache/arrow-rs/issues/5853
> >
> > On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> > <al...@databricks.com.invalid> wrote:
> >
> > > Hi Julien.
> > >
> > > Thank you for reconnecting the threads.
> > >
> > > I have broken down my experiments in a narrative, commit by commit on
> how
> > > we can go from flatbuffers being ~2x larger than thrift to being
> smaller
> > > (and at times even half) the size of thrift. This is still on an
> internal
> > > branch, I will resume work towards the end of this month to port it to
> > > arrow so that folks can look at the progress and share ideas.
> > >
> > > On the benchmarking front I need to build and share a binary for third
> > > parties to donate their footers for analysis.
> > >
> > > The PR for parquet extensions has gotten a few rounds of reviews:
> > > https://github.com/apache/parquet-format/pull/254. I hope it will be
> > > merged
> > > soon.
> > >
> > > I missed the sync yesterday - for some reason I didn't receive an
> > > invitation. Julien could you add me again to the invite list?
> > >
> > > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org>
> wrote:
> > >
> > > > This came up in the sync today.
> > > >
> > > > There are a few concurrent experiments with flatbuffers for a future
> > > > Parquet footer replacement. In itself it is fine and just wanted to
> > > > reconnect the threads here so that folks are aware of each other and
> > can
> > > > share findings.
> > > >
> > > > - Neelaksh benchmarking and experiments:
> > > >
> > > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > > >
> > > > - Alkis has also been experimenting and led the proposal for enabling
> > > > extending the existing footer.
> > > >
> > > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > > >
> > > > - Xuwei also shared that he is looking into this.
> > > >
> > > > I would suggest that you all reply to this thread sharing your
> current
> > > > progress or ideas and a link to your respective repos for
> > experimenting.
> > > >
> > > > Best
> > > > Julien
> > > >
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Alkis Evlogimenos <al...@databricks.com.INVALID>.
The difference in parsing speed between thrift and flatbuffer is >25x.
Thrift has some fundamental design decisions that make decoding slow:
1. the thrift compact protocol is very data dependent: uleb encoding for
integers, field ids are deltas from previous. The data dependencies
disallow pipelining of modern cpus
2. object model does not have a way to use arenas to avoid many allocations
of objects
If we keep thrift, we can potentially get 2 fixed, but fixing 1 requires
changes to the thrift serialization protocol. Such a change is not
different from switching serialization format.
On Thu, Aug 15, 2024 at 12:30 PM Andrew Lamb <an...@gmail.com> wrote:
> I wanted to share some work Xiangpeng Hao did at InfluxData this summer on
> the current (thrift) metadata format[1].
>
> We found that with careful software engineering, we could likely improve
> the speed of reading existing parquet footer format by a factor of 4 or
> more ([2] contains some specific ideas). While we analyzed the
> Rust implementation, I believe a similar conclusion applies to C/C++.
>
> I realize that there are certain features that switching to an entirely new
> footer format would achieve, but the cost to adopting a new format
> across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
>
> It is my opinion that investing the same effort in software optimization
> that would be required for a new footer format would have a much bigger
> impact
>
> Andrew
>
> [1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
> [2]: https://github.com/apache/arrow-rs/issues/5853
>
> On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
> <al...@databricks.com.invalid> wrote:
>
> > Hi Julien.
> >
> > Thank you for reconnecting the threads.
> >
> > I have broken down my experiments in a narrative, commit by commit on how
> > we can go from flatbuffers being ~2x larger than thrift to being smaller
> > (and at times even half) the size of thrift. This is still on an internal
> > branch, I will resume work towards the end of this month to port it to
> > arrow so that folks can look at the progress and share ideas.
> >
> > On the benchmarking front I need to build and share a binary for third
> > parties to donate their footers for analysis.
> >
> > The PR for parquet extensions has gotten a few rounds of reviews:
> > https://github.com/apache/parquet-format/pull/254. I hope it will be
> > merged
> > soon.
> >
> > I missed the sync yesterday - for some reason I didn't receive an
> > invitation. Julien could you add me again to the invite list?
> >
> > On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org> wrote:
> >
> > > This came up in the sync today.
> > >
> > > There are a few concurrent experiments with flatbuffers for a future
> > > Parquet footer replacement. In itself it is fine and just wanted to
> > > reconnect the threads here so that folks are aware of each other and
> can
> > > share findings.
> > >
> > > - Neelaksh benchmarking and experiments:
> > >
> > >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> > >
> > > - Alkis has also been experimenting and led the proposal for enabling
> > > extending the existing footer.
> > >
> > >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> > >
> > > - Xuwei also shared that he is looking into this.
> > >
> > > I would suggest that you all reply to this thread sharing your current
> > > progress or ideas and a link to your respective repos for
> experimenting.
> > >
> > > Best
> > > Julien
> > >
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Andrew Lamb <an...@gmail.com>.
I wanted to share some work Xiangpeng Hao did at InfluxData this summer on
the current (thrift) metadata format[1].
We found that with careful software engineering, we could likely improve
the speed of reading existing parquet footer format by a factor of 4 or
more ([2] contains some specific ideas). While we analyzed the
Rust implementation, I believe a similar conclusion applies to C/C++.
I realize that there are certain features that switching to an entirely new
footer format would achieve, but the cost to adopting a new format
across the ecosystem is immense (e.g. Parquet "version 2.0" etc).
It is my opinion that investing the same effort in software optimization
that would be required for a new footer format would have a much bigger
impact
Andrew
[1]: https://www.influxdata.com/blog/how-good-parquet-wide-tables/
[2]: https://github.com/apache/arrow-rs/issues/5853
On Thu, Aug 15, 2024 at 4:26 AM Alkis Evlogimenos
<al...@databricks.com.invalid> wrote:
> Hi Julien.
>
> Thank you for reconnecting the threads.
>
> I have broken down my experiments in a narrative, commit by commit on how
> we can go from flatbuffers being ~2x larger than thrift to being smaller
> (and at times even half) the size of thrift. This is still on an internal
> branch, I will resume work towards the end of this month to port it to
> arrow so that folks can look at the progress and share ideas.
>
> On the benchmarking front I need to build and share a binary for third
> parties to donate their footers for analysis.
>
> The PR for parquet extensions has gotten a few rounds of reviews:
> https://github.com/apache/parquet-format/pull/254. I hope it will be
> merged
> soon.
>
> I missed the sync yesterday - for some reason I didn't receive an
> invitation. Julien could you add me again to the invite list?
>
> On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org> wrote:
>
> > This came up in the sync today.
> >
> > There are a few concurrent experiments with flatbuffers for a future
> > Parquet footer replacement. In itself it is fine and just wanted to
> > reconnect the threads here so that folks are aware of each other and can
> > share findings.
> >
> > - Neelaksh benchmarking and experiments:
> >
> >
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> > https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> >
> > - Alkis has also been experimenting and led the proposal for enabling
> > extending the existing footer.
> >
> >
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
> >
> > - Xuwei also shared that he is looking into this.
> >
> > I would suggest that you all reply to this thread sharing your current
> > progress or ideas and a link to your respective repos for experimenting.
> >
> > Best
> > Julien
> >
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Alkis Evlogimenos <al...@databricks.com.INVALID>.
Hi Julien.
Thank you for reconnecting the threads.
I have broken down my experiments in a narrative, commit by commit on how
we can go from flatbuffers being ~2x larger than thrift to being smaller
(and at times even half) the size of thrift. This is still on an internal
branch, I will resume work towards the end of this month to port it to
arrow so that folks can look at the progress and share ideas.
On the benchmarking front I need to build and share a binary for third
parties to donate their footers for analysis.
The PR for parquet extensions has gotten a few rounds of reviews:
https://github.com/apache/parquet-format/pull/254. I hope it will be merged
soon.
I missed the sync yesterday - for some reason I didn't receive an
invitation. Julien could you add me again to the invite list?
On Thu, Aug 15, 2024 at 1:32 AM Julien Le Dem <ju...@apache.org> wrote:
> This came up in the sync today.
>
> There are a few concurrent experiments with flatbuffers for a future
> Parquet footer replacement. In itself it is fine and just wanted to
> reconnect the threads here so that folks are aware of each other and can
> share findings.
>
> - Neelaksh benchmarking and experiments:
>
> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>
> - Alkis has also been experimenting and led the proposal for enabling
> extending the existing footer.
>
> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>
> - Xuwei also shared that he is looking into this.
>
> I would suggest that you all reply to this thread sharing your current
> progress or ideas and a link to your respective repos for experimenting.
>
> Best
> Julien
>
Re: [DISCUSS] new Parquet footer experiments
Posted by Neelaksh Singh <ne...@gmail.com>.
Hello everyone. My name is Neelaksh. I am currently collaborating with
G-Research as a Software Engineer Intern on conducting extensive
benchmarking of Apache Parquet-CPP performance, focusing on metadata
handling, data read operations, schema processing, and compression
algorithms. We analyzed how factors such as the number of columns,
chunking, paging, and statistics levels impact metadata decode time, file
size, and read performance. These results provide valuable insights into
Parquet's performance characteristics for wide tables, helping to identify
optimal configurations for different use cases and potential areas for
optimization in Parquet file handling and processing.
As a next step I will be working on Flatbuffers benchmarking. Currently I
have implemented a benchmarking suite for comparing Parquet metadata
handling using Thrift and FlatBuffer encodings. It generates test Parquet
files, converts metadata between Thrift and FlatBuffer formats, and
measures parsing times for both encodings. The suite includes benchmarks
for parsing Thrift metadata, encoding and parsing FlatBuffer metadata, and
a combined approach that appends FlatBuffer data to Thrift metadata. The
benchmarks are configured to run with different column counts (3000 and
2000) to evaluate performance across varying metadata sizes, ultimately
aiming to assess the potential benefits of using FlatBuffer as an
alternative or extension to the current Thrift-based metadata in Parquet
files.
Links:
1. Medium Post -
https://neelaksh-singh.medium.com/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
2. Reproducible Repo -
https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
3. Documentation (Ongoing) -
https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking/blob/main/Parquet-CPP-Benchmarking.ipynb
4. Flabuffer Code -
https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking/blob/main/src/pq_fb_ns_data_generator.cc
Things are still WIP. I am open for collaboration and look forward to your
suggestions.
On Thu, Aug 15, 2024, 6:29 PM Neelaksh Singh <ne...@gmail.com> wrote:
> Hello everyone. My name is Neelaksh. I am currently collaborating with
> G-Research as a Software Engineer Intern on conducting extensive
> benchmarking of Apache Parquet-CPP performance, focusing on metadata
> handling, data read operations, schema processing, and compression
> algorithms. We analyzed how factors such as the number of columns,
> chunking, paging, and statistics levels impact metadata decode time, file
> size, and read performance. These results provide valuable insights into
> Parquet's performance characteristics for wide tables, helping to identify
> optimal configurations for different use cases and potential areas for
> optimization in Parquet file handling and processing.
>
> As a next step I will be working on Flatbuffers benchmarking. Currently I
> have implemented a benchmarking suite for comparing Parquet metadata
> handling using Thrift and FlatBuffer encodings. It generates test Parquet
> files, converts metadata between Thrift and FlatBuffer formats, and
> measures parsing times for both encodings. The suite includes benchmarks
> for parsing Thrift metadata, encoding and parsing FlatBuffer metadata, and
> a combined approach that appends FlatBuffer data to Thrift metadata. The
> benchmarks are configured to run with different column counts (3000 and
> 2000) to evaluate performance across varying metadata sizes, ultimately
> aiming to assess the potential benefits of using FlatBuffer as an
> alternative or extension to the current Thrift-based metadata in Parquet
> files.
>
> Links:
>
> 1. Medium Post -
> https://neelaksh-singh.medium.com/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
> 2. Reproducible Repo -
> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
> 3. Documentation (Ongoing) -
> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking/blob/main/Parquet-CPP-Benchmarking.ipynb
> 4. Flabuffer Code -
> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking/blob/main/src/pq_fb_ns_data_generator.cc
>
>
> Things are still WIP. I am open for collaboration and look forward to your
> suggestions.
>
> On Thu, Aug 15, 2024, 5:02 AM Julien Le Dem <ju...@apache.org> wrote:
>
>> This came up in the sync today.
>>
>> There are a few concurrent experiments with flatbuffers for a future
>> Parquet footer replacement. In itself it is fine and just wanted to
>> reconnect the threads here so that folks are aware of each other and can
>> share findings.
>>
>> - Neelaksh benchmarking and experiments:
>>
>> https://medium.com/@neelaksh-singh/benchmarking-apache-parquet-my-mid-program-journey-as-an-mlh-fellow-bc0b8332c3b1
>> https://github.com/Neelaksh-Singh/gresearch_parquet_benchmarking
>>
>> - Alkis has also been experimenting and led the proposal for enabling
>> extending the existing footer.
>>
>> https://docs.google.com/document/d/1KkoR0DjzYnLQXO-d0oRBv2k157IZU0_injqd4eV4WiI/edit#heading=h.15ohoov5qqm6
>>
>> - Xuwei also shared that he is looking into this.
>>
>> I would suggest that you all reply to this thread sharing your current
>> progress or ideas and a link to your respective repos for experimenting.
>>
>> Best
>> Julien
>>
>